| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="SkeletonModificationStack2D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A resource that holds a stack of [SkeletonModification2D]s. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | This resource is used by the Skeleton and holds a stack of [SkeletonModification2D]s. |
| 8 | 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 [i]before[/i] the arms on a humanoid skeleton. |
| 9 | This resource also controls how strongly all of the modifications are applied to the [Skeleton2D]. |
| 10 | </description> |
| 11 | <tutorials> |
| 12 | </tutorials> |
| 13 | <methods> |
| 14 | <method name="add_modification"> |
| 15 | <return type="void" /> |
| 16 | <param index="0" name="modification" type="SkeletonModification2D" /> |
| 17 | <description> |
| 18 | Adds the passed-in [SkeletonModification2D] to the stack. |
| 19 | </description> |
| 20 | </method> |
| 21 | <method name="delete_modification"> |
| 22 | <return type="void" /> |
| 23 | <param index="0" name="mod_idx" type="int" /> |
| 24 | <description> |
| 25 | Deletes the [SkeletonModification2D] at the index position [param mod_idx], if it exists. |
| 26 | </description> |
| 27 | </method> |
| 28 | <method name="enable_all_modifications"> |
| 29 | <return type="void" /> |
| 30 | <param index="0" name="enabled" type="bool" /> |
| 31 | <description> |
| 32 | Enables all [SkeletonModification2D]s in the stack. |
| 33 | </description> |
| 34 | </method> |
| 35 | <method name="execute"> |
| 36 | <return type="void" /> |
| 37 | <param index="0" name="delta" type="float" /> |
| 38 | <param index="1" name="execution_mode" type="int" /> |
| 39 | <description> |
| 40 | Executes all of the [SkeletonModification2D]s in the stack that use the same execution mode as the passed-in [param execution_mode], starting from index [code]0[/code] to [member modification_count]. |
| 41 | [b]Note:[/b] 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. |
| 42 | </description> |
| 43 | </method> |
| 44 | <method name="get_is_setup" qualifiers="const"> |
| 45 | <return type="bool" /> |
| 46 | <description> |
| 47 | Returns a boolean that indicates whether the modification stack is setup and can execute. |
| 48 | </description> |
| 49 | </method> |
| 50 | <method name="get_modification" qualifiers="const"> |
| 51 | <return type="SkeletonModification2D" /> |
| 52 | <param index="0" name="mod_idx" type="int" /> |
| 53 | <description> |
| 54 | Returns the [SkeletonModification2D] at the passed-in index, [param mod_idx]. |
| 55 | </description> |
| 56 | </method> |
| 57 | <method name="get_skeleton" qualifiers="const"> |
| 58 | <return type="Skeleton2D" /> |
| 59 | <description> |
| 60 | Returns the [Skeleton2D] node that the SkeletonModificationStack2D is bound to. |
| 61 | </description> |
| 62 | </method> |
| 63 | <method name="set_modification"> |
| 64 | <return type="void" /> |
| 65 | <param index="0" name="mod_idx" type="int" /> |
| 66 | <param index="1" name="modification" type="SkeletonModification2D" /> |
| 67 | <description> |
| 68 | Sets the modification at [param mod_idx] to the passed-in modification, [param modification]. |
| 69 | </description> |
| 70 | </method> |
| 71 | <method name="setup"> |
| 72 | <return type="void" /> |
| 73 | <description> |
| 74 | 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. |
| 75 | </description> |
| 76 | </method> |
| 77 | </methods> |
| 78 | <members> |
| 79 | <member name="enabled" type="bool" setter="set_enabled" getter="get_enabled" default="false"> |
| 80 | If [code]true[/code], the modification's in the stack will be called. This is handled automatically through the [Skeleton2D] node. |
| 81 | </member> |
| 82 | <member name="modification_count" type="int" setter="set_modification_count" getter="get_modification_count" default="0"> |
| 83 | The number of modifications in the stack. |
| 84 | </member> |
| 85 | <member name="strength" type="float" setter="set_strength" getter="get_strength" default="1.0"> |
| 86 | The interpolation strength of the modifications in stack. A value of [code]0[/code] will make it where the modifications are not applied, a strength of [code]0.5[/code] will be half applied, and a strength of [code]1[/code] will allow the modifications to be fully applied and override the [Skeleton2D] [Bone2D] poses. |
| 87 | </member> |
| 88 | </members> |
| 89 | </class> |