SkeletonModificationStack2D
A resource that holds a stack of SkeletonModification2Ds.
A resource that holds a stack of SkeletonModification2Ds.
This resource is used by the Skeleton and holds a stack of SkeletonModification2Ds.
This controls the order of the modifications and how they are applied. Modification order is especially important for full-body IK setups, as you need to execute the modifications in the correct order to get the desired results. For example, you want to execute a modification on the spine before the arms on a humanoid skeleton.
This resource also controls how strongly all of the modifications are applied to the Skeleton2D.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
SkeletonModificationStack2DConstructor
public SkeletonModificationStack2D();Properties3
EnabledProperty
public bool Enabled { get; set; }If true, the modifications in the stack will be called. This is handled automatically through the Skeleton2D node.
ModificationCountProperty
public int ModificationCount { get; set; }The number of modifications in the stack.
StrengthProperty
public float Strength { get; set; }The interpolation strength of the modifications in stack. A value of 0 will make it where the modifications are not applied, a strength of 0.5 will be half applied, and a strength of 1 will allow the modifications to be fully applied and override the Skeleton2D Bone2D poses.
Methods15
AddModificationvoid
public void AddModification(SkeletonModification2D modification);Adds the passed-in SkeletonModification2D to the stack.
| Name | Type | Default |
|---|---|---|
modification | SkeletonModification2D | — |
DeleteModificationvoid
public void DeleteModification(int modIdx);Deletes the SkeletonModification2D at the index position mod_idx, if it exists.
| Name | Type | Default |
|---|---|---|
modIdx | int | — |
EnableAllModificationsvoid
public void EnableAllModifications(bool enabled);Enables all SkeletonModification2Ds in the stack.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
Executevoid
public void Execute(float delta, int executionMode);Executes all of the SkeletonModification2Ds in the stack that use the same execution mode as the passed-in execution_mode, starting from index 0 to SkeletonModificationStack2D.ModificationCount.
Note: The order of the modifications can matter depending on the modifications. For example, modifications on a spine should operate before modifications on the arms in order to get proper results.
| Name | Type | Default |
|---|---|---|
delta | float | — |
executionMode | int | — |
GetEnabledbool
public bool GetEnabled();boolGetIsSetupbool
public bool GetIsSetup();Returns a boolean that indicates whether the modification stack is setup and can execute.
boolGetModificationSkeletonModification2D
public SkeletonModification2D GetModification(int modIdx);Returns the SkeletonModification2D at the passed-in index, mod_idx.
| Name | Type | Default |
|---|---|---|
modIdx | int | — |
SkeletonModification2DGetModificationCountint
public int GetModificationCount();intGetSkeletonSkeleton2D
public Skeleton2D GetSkeleton();Returns the Skeleton2D node that the SkeletonModificationStack2D is bound to.
Skeleton2DGetStrengthfloat
public float GetStrength();floatSetEnabledvoid
public void SetEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetModificationvoid
public void SetModification(int modIdx, SkeletonModification2D modification);Sets the modification at mod_idx to the passed-in modification, modification.
| Name | Type | Default |
|---|---|---|
modIdx | int | — |
modification | SkeletonModification2D | — |
SetModificationCountvoid
public void SetModificationCount(int count);| Name | Type | Default |
|---|---|---|
count | int | — |
SetStrengthvoid
public void SetStrength(float strength);| Name | Type | Default |
|---|---|---|
strength | float | — |
Setupvoid
public void Setup();Sets up the modification stack so it can execute. This function should be called by Skeleton2D and shouldn't be manually called unless you know what you are doing.