DynamicBone AppendParticles rewrite #72

Merged
Njaecha merged 4 commits from FixDynamicBoneAppendParticles into master 2025-01-02 12:29:04 +00:00
Njaecha commented 2025-01-02 00:53:44 +00:00 (Migrated from github.com)

Rewrote the method since it had a logic flaw that made it impossible to have multiple consecutive bones in the m_notRolls list.
Adding all children to m_Exclusions will still make the chain end prematurely.

Rewrote the method since it had a logic flaw that made it impossible to have multiple consecutive bones in the m_notRolls list. Adding all children to m_Exclusions will still make the chain end prematurely.
Njaecha commented 2025-01-02 00:58:28 +00:00 (Migrated from github.com)

The old Transpiler is no longer needed since it patched part of the method that this replaces entirely.

The old Transpiler is no longer needed since it patched part of the method that this replaces entirely.
Njaecha commented 2025-01-02 02:44:23 +00:00 (Migrated from github.com)

More detailed explanation of what the patch fixes

Without this it is not possible to add multiple consecutive "chain links" (transforms that would become particles) in the m_notRolls list because the recursive method call loop would end. The m_notRolls list is used to disable/skip chain links in the dynamic bone chain.
Furthermore this fixes, that, when the chain is ended prematurely (by adding all children of a chain link to the m_Exclusions list), the EndOffset settings will be ignored. It also fixes that, in HS2, the chain would end as soon as m_notRolls was used and an EndOffset is configured.
The previous fix for the m_Excludes list is included here by using .Contains().

## More detailed explanation of what the patch fixes Without this it is not possible to **add multiple consecutive "chain links" (transforms that would become particles) in the m_notRolls list** because the recursive method call loop would end. The m_notRolls list is used to disable/skip chain links in the dynamic bone chain. Furthermore this fixes, that, when the chain is ended prematurely (by adding all children of a chain link to the m_Exclusions list), the EndOffset settings will be ignored. It also fixes that, in HS2, the chain would end as soon as m_notRolls was used and an EndOffset is configured. The previous fix for the m_Excludes list is included here by using .Contains().
ManlyMarco (Migrated from github.com) reviewed 2025-01-02 12:28:13 +00:00
@ -56,0 +42,4 @@
particle.m_InitLocalPosition = bone.localPosition;
particle.m_InitLocalRotation = bone.localRotation;
}
else
ManlyMarco (Migrated from github.com) commented 2025-01-02 12:28:12 +00:00
            /// <summary>
            /// Without this it is not possible to add multiple consecutive "chain links" (transforms that would become particles) in the m_notRolls list because the recursive method call loop would end. The m_notRolls list is used to disable/skip chain links in the dynamic bone chain.
            /// Furthermore this fixes, that, when the chain is ended prematurely (by adding all children of a chain link to the m_Exclusions list), the EndOffset settings will be ignored. It also fixes that, in HS2, the chain would end as soon as m_notRolls was used and an EndOffset is configured.
            /// The previous fix for the m_Excludes list is included here by using .Contains().
            /// </summary>
            public static void AppendParticles(Transform bone, int parentIndex, float boneLength, DynamicBone dynamicBone)
```suggestion /// <summary> /// Without this it is not possible to add multiple consecutive "chain links" (transforms that would become particles) in the m_notRolls list because the recursive method call loop would end. The m_notRolls list is used to disable/skip chain links in the dynamic bone chain. /// Furthermore this fixes, that, when the chain is ended prematurely (by adding all children of a chain link to the m_Exclusions list), the EndOffset settings will be ignored. It also fixes that, in HS2, the chain would end as soon as m_notRolls was used and an EndOffset is configured. /// The previous fix for the m_Excludes list is included here by using .Contains(). /// </summary> public static void AppendParticles(Transform bone, int parentIndex, float boneLength, DynamicBone dynamicBone) ```
ManlyMarco (Migrated from github.com) approved these changes 2025-01-02 12:28:34 +00:00
Sign in to join this conversation.
No description provided.