BoneTwistDisperser3D
A node that propagates and disperses the child bone's twist to the parent bones.
A node that propagates and disperses the child bone's twist to the parent bones.
This BoneTwistDisperser3D allows for smooth twist interpolation between multiple bones by dispersing the end bone's twist to the parents. This only changes the twist without changing the global position of each joint.
This is useful for smoothly twisting bones in combination with CopyTransformModifier3D and IK.
Note: If an extracted twist is greater than 180 degrees, flipping occurs. This is similar to ConvertTransformModifier3D.
Note: Most methods in this class take an index parameter. This parameter specifies which setting list entry to return if the IK has multiple entries (e.g. settings/<index>/root_bone_name).
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
BoneTwistDisperser3DConstructor
public BoneTwistDisperser3D();Properties2
MutableBoneAxesProperty
public bool MutableBoneAxes { get; set; }If true, the solver retrieves the bone axis from the bone pose every frame.
If false, the solver retrieves the bone axis from the bone rest and caches it.
SettingCountProperty
public int SettingCount { get; set; }The number of settings.
Methods34
AreBoneAxesMutablebool
public bool AreBoneAxesMutable();boolClearSettingsvoid
public void ClearSettings();Clears all settings.
GetDampingCurveCurve
public Curve GetDampingCurve(int index);Returns the damping curve when BoneTwistDisperser3D.GetDisperseMode is BoneTwistDisperser3D.DisperseMode.Custom.
| Name | Type | Default |
|---|---|---|
index | int | — |
CurveGetDisperseModeBoneTwistDisperser3D.DisperseMode
public BoneTwistDisperser3D.DisperseMode GetDisperseMode(int index);Returns whether to use automatic amount assignment or to allow manual assignment.
| Name | Type | Default |
|---|---|---|
index | int | — |
BoneTwistDisperser3D.DisperseModeGetEndBoneint
public int GetEndBone(int index);Returns the end bone index of the bone chain.
| Name | Type | Default |
|---|---|---|
index | int | — |
intGetEndBoneDirectionSkeletonModifier3D.BoneDirection
public SkeletonModifier3D.BoneDirection GetEndBoneDirection(int index);Returns the tail direction of the end bone of the bone chain when BoneTwistDisperser3D.IsEndBoneExtended is true.
| Name | Type | Default |
|---|---|---|
index | int | — |
SkeletonModifier3D.BoneDirectionGetEndBoneNamestring
public string GetEndBoneName(int index);Returns the end bone name of the bone chain.
| Name | Type | Default |
|---|---|---|
index | int | — |
stringGetJointBoneint
public int GetJointBone(int index, int joint);Returns the bone index at joint in the bone chain's joint list.
| Name | Type | Default |
|---|---|---|
index | int | — |
joint | int | — |
intGetJointBoneNamestring
public string GetJointBoneName(int index, int joint);Returns the bone name at joint in the bone chain's joint list.
| Name | Type | Default |
|---|---|---|
index | int | — |
joint | int | — |
stringGetJointCountint
public int GetJointCount(int index);Returns the joint count of the bone chain's joint list.
| Name | Type | Default |
|---|---|---|
index | int | — |
intGetJointTwistAmountfloat
public float GetJointTwistAmount(int index, int joint);Returns the twist amount at joint in the bone chain's joint list when BoneTwistDisperser3D.GetDisperseMode is BoneTwistDisperser3D.DisperseMode.Custom.
| Name | Type | Default |
|---|---|---|
index | int | — |
joint | int | — |
floatGetReferenceBoneint
public int GetReferenceBone(int index);Returns the reference bone to extract twist of the setting at index.
This bone is either the end of the chain or its parent, depending on BoneTwistDisperser3D.IsEndBoneExtended.
| Name | Type | Default |
|---|---|---|
index | int | — |
intGetReferenceBoneNamestring
public string GetReferenceBoneName(int index);Returns the reference bone name to extract twist of the setting at index.
This bone is either the end of the chain or its parent, depending on BoneTwistDisperser3D.IsEndBoneExtended.
| Name | Type | Default |
|---|---|---|
index | int | — |
stringGetRootBoneint
public int GetRootBone(int index);Returns the root bone index of the bone chain.
| Name | Type | Default |
|---|---|---|
index | int | — |
intGetRootBoneNamestring
public string GetRootBoneName(int index);Returns the root bone name of the bone chain.
| Name | Type | Default |
|---|---|---|
index | int | — |
stringGetSettingCountint
public int GetSettingCount();intGetTwistFromQuaternion
public Quaternion GetTwistFrom(int index);Returns the rotation to an arbitrary state before twisting for the current bone pose to extract the twist when BoneTwistDisperser3D.IsTwistFromRest is false.
| Name | Type | Default |
|---|---|---|
index | int | — |
QuaternionGetWeightPositionfloat
public float GetWeightPosition(int index);Returns the position at which to divide the segment between joints for weight assignment when BoneTwistDisperser3D.GetDisperseMode is BoneTwistDisperser3D.DisperseMode.Weighted.
| Name | Type | Default |
|---|---|---|
index | int | — |
floatIsEndBoneExtendedbool
public bool IsEndBoneExtended(int index);Returns true if the end bone is extended to have a tail.
| Name | Type | Default |
|---|---|---|
index | int | — |
boolIsTwistFromRestbool
public bool IsTwistFromRest(int index);Returns true if extracting the twist amount from the difference between the bone rest and the current bone pose.
| Name | Type | Default |
|---|---|---|
index | int | — |
boolSetDampingCurvevoid
public void SetDampingCurve(int index, Curve curve);Sets the damping curve when BoneTwistDisperser3D.GetDisperseMode is BoneTwistDisperser3D.DisperseMode.Custom.
| Name | Type | Default |
|---|---|---|
index | int | — |
curve | Curve | — |
SetDisperseModevoid
public void SetDisperseMode(int index, BoneTwistDisperser3D.DisperseMode disperseMode);Sets whether to use automatic amount assignment or to allow manual assignment.
| Name | Type | Default |
|---|---|---|
index | int | — |
disperseMode | BoneTwistDisperser3D.DisperseMode | — |
SetEndBonevoid
public void SetEndBone(int index, int bone);Sets the end bone index of the bone chain.
| Name | Type | Default |
|---|---|---|
index | int | — |
bone | int | — |
SetEndBoneDirectionvoid
public void SetEndBoneDirection(int index, SkeletonModifier3D.BoneDirection boneDirection);Sets the end bone tail direction of the bone chain when BoneTwistDisperser3D.IsEndBoneExtended is true.
| Name | Type | Default |
|---|---|---|
index | int | — |
boneDirection | SkeletonModifier3D.BoneDirection | — |
SetEndBoneNamevoid
public void SetEndBoneName(int index, string boneName);Sets the end bone name of the bone chain. Note: The end bone must be a child of the root bone.
| Name | Type | Default |
|---|---|---|
index | int | — |
boneName | string | — |
SetExtendEndBonevoid
public void SetExtendEndBone(int index, bool enabled);If enabled is true, the end bone is extended to have a tail.
If enabled is false, BoneTwistDisperser3D.GetReferenceBone becomes a parent of the end bone and it uses the vector to the end bone as a twist axis.
| Name | Type | Default |
|---|---|---|
index | int | — |
enabled | bool | — |
SetJointTwistAmountvoid
public void SetJointTwistAmount(int index, int joint, float twistAmount);Sets the twist amount at joint in the bone chain's joint list when BoneTwistDisperser3D.GetDisperseMode is BoneTwistDisperser3D.DisperseMode.Custom.
| Name | Type | Default |
|---|---|---|
index | int | — |
joint | int | — |
twistAmount | float | — |
SetMutableBoneAxesvoid
public void SetMutableBoneAxes(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetRootBonevoid
public void SetRootBone(int index, int bone);Sets the root bone index of the bone chain.
| Name | Type | Default |
|---|---|---|
index | int | — |
bone | int | — |
SetRootBoneNamevoid
public void SetRootBoneName(int index, string boneName);Sets the root bone name of the bone chain.
| Name | Type | Default |
|---|---|---|
index | int | — |
boneName | string | — |
SetSettingCountvoid
public void SetSettingCount(int count);| Name | Type | Default |
|---|---|---|
count | int | — |
SetTwistFromvoid
public void SetTwistFrom(int index, Quaternion from);Sets the rotation to an arbitrary state before twisting for the current bone pose to extract the twist when BoneTwistDisperser3D.IsTwistFromRest is false.
In other words, by calling BoneTwistDisperser3D.SetTwistFrom by SkeletonModifier3D.ModificationProcessed of a specific SkeletonModifier3D, you can extract only the twists generated by modifiers processed after that but before this BoneTwistDisperser3D.
| Name | Type | Default |
|---|---|---|
index | int | — |
from | Quaternion | — |
SetTwistFromRestvoid
public void SetTwistFromRest(int index, bool enabled);If enabled is true, it extracts the twist amount from the difference between the bone rest and the current bone pose.
If enabled is false, it extracts the twist amount from the difference between BoneTwistDisperser3D.GetTwistFrom and the current bone pose. See also BoneTwistDisperser3D.SetTwistFrom.
| Name | Type | Default |
|---|---|---|
index | int | — |
enabled | bool | — |
SetWeightPositionvoid
public void SetWeightPosition(int index, float weightPosition);Sets the position at which to divide the segment between joints for weight assignment when BoneTwistDisperser3D.GetDisperseMode is BoneTwistDisperser3D.DisperseMode.Weighted.
For example, when weight_position is 0.5, if two bone segments with a length of 1.0 exist between three joints, weights are assigned to each joint from root to end at ratios of 0.5, 1.0, and 0.5. Then amounts become 0.25, 0.75, and 1.0 respectively.
| Name | Type | Default |
|---|---|---|
index | int | — |
weightPosition | float | — |
BoneTwistDisperser3D.DisperseMode
| Value | Description |
|---|---|
Custom = 2 | You can assign arbitrary amounts to the joint list. See also |
Even = 0 | Assign amounts so that they monotonically increase from |
Weighted = 1 | Assign amounts so that they monotonically increase from |