class_skeletonmodificationstack2d.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SkeletonModificationStack2D.xml.
  6. .. _class_SkeletonModificationStack2D:
  7. SkeletonModificationStack2D
  8. ===========================
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A resource that holds a stack of :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ s.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This resource is used by the Skeleton and holds a stack of :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ s.
  15. 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.
  16. This resource also controls how strongly all of the modifications are applied to the :ref:`Skeleton2D<class_Skeleton2D>`.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +---------------------------+------------------------------------------------------------------------------------------+-----------+
  23. | :ref:`bool<class_bool>` | :ref:`enabled<class_SkeletonModificationStack2D_property_enabled>` | ``false`` |
  24. +---------------------------+------------------------------------------------------------------------------------------+-----------+
  25. | :ref:`int<class_int>` | :ref:`modification_count<class_SkeletonModificationStack2D_property_modification_count>` | ``0`` |
  26. +---------------------------+------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`float<class_float>` | :ref:`strength<class_SkeletonModificationStack2D_property_strength>` | ``1.0`` |
  28. +---------------------------+------------------------------------------------------------------------------------------+-----------+
  29. .. rst-class:: classref-reftable-group
  30. Methods
  31. -------
  32. .. table::
  33. :widths: auto
  34. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`add_modification<class_SkeletonModificationStack2D_method_add_modification>` **(** :ref:`SkeletonModification2D<class_SkeletonModification2D>` modification **)** |
  36. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`delete_modification<class_SkeletonModificationStack2D_method_delete_modification>` **(** :ref:`int<class_int>` mod_idx **)** |
  38. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`enable_all_modifications<class_SkeletonModificationStack2D_method_enable_all_modifications>` **(** :ref:`bool<class_bool>` enabled **)** |
  40. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`execute<class_SkeletonModificationStack2D_method_execute>` **(** :ref:`float<class_float>` delta, :ref:`int<class_int>` execution_mode **)** |
  42. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`get_is_setup<class_SkeletonModificationStack2D_method_get_is_setup>` **(** **)** |const| |
  44. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`SkeletonModification2D<class_SkeletonModification2D>` | :ref:`get_modification<class_SkeletonModificationStack2D_method_get_modification>` **(** :ref:`int<class_int>` mod_idx **)** |const| |
  46. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Skeleton2D<class_Skeleton2D>` | :ref:`get_skeleton<class_SkeletonModificationStack2D_method_get_skeleton>` **(** **)** |const| |
  48. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`set_modification<class_SkeletonModificationStack2D_method_set_modification>` **(** :ref:`int<class_int>` mod_idx, :ref:`SkeletonModification2D<class_SkeletonModification2D>` modification **)** |
  50. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`setup<class_SkeletonModificationStack2D_method_setup>` **(** **)** |
  52. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. .. rst-class:: classref-section-separator
  54. ----
  55. .. rst-class:: classref-descriptions-group
  56. Property Descriptions
  57. ---------------------
  58. .. _class_SkeletonModificationStack2D_property_enabled:
  59. .. rst-class:: classref-property
  60. :ref:`bool<class_bool>` **enabled** = ``false``
  61. .. rst-class:: classref-property-setget
  62. - void **set_enabled** **(** :ref:`bool<class_bool>` value **)**
  63. - :ref:`bool<class_bool>` **get_enabled** **(** **)**
  64. If ``true``, the modification's in the stack will be called. This is handled automatically through the :ref:`Skeleton2D<class_Skeleton2D>` node.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_SkeletonModificationStack2D_property_modification_count:
  68. .. rst-class:: classref-property
  69. :ref:`int<class_int>` **modification_count** = ``0``
  70. .. rst-class:: classref-property-setget
  71. - void **set_modification_count** **(** :ref:`int<class_int>` value **)**
  72. - :ref:`int<class_int>` **get_modification_count** **(** **)**
  73. The number of modifications in the stack.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_SkeletonModificationStack2D_property_strength:
  77. .. rst-class:: classref-property
  78. :ref:`float<class_float>` **strength** = ``1.0``
  79. .. rst-class:: classref-property-setget
  80. - void **set_strength** **(** :ref:`float<class_float>` value **)**
  81. - :ref:`float<class_float>` **get_strength** **(** **)**
  82. 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 :ref:`Skeleton2D<class_Skeleton2D>` :ref:`Bone2D<class_Bone2D>` poses.
  83. .. rst-class:: classref-section-separator
  84. ----
  85. .. rst-class:: classref-descriptions-group
  86. Method Descriptions
  87. -------------------
  88. .. _class_SkeletonModificationStack2D_method_add_modification:
  89. .. rst-class:: classref-method
  90. void **add_modification** **(** :ref:`SkeletonModification2D<class_SkeletonModification2D>` modification **)**
  91. Adds the passed-in :ref:`SkeletonModification2D<class_SkeletonModification2D>` to the stack.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_SkeletonModificationStack2D_method_delete_modification:
  95. .. rst-class:: classref-method
  96. void **delete_modification** **(** :ref:`int<class_int>` mod_idx **)**
  97. Deletes the :ref:`SkeletonModification2D<class_SkeletonModification2D>` at the index position ``mod_idx``, if it exists.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_SkeletonModificationStack2D_method_enable_all_modifications:
  101. .. rst-class:: classref-method
  102. void **enable_all_modifications** **(** :ref:`bool<class_bool>` enabled **)**
  103. Enables all :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ s in the stack.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_SkeletonModificationStack2D_method_execute:
  107. .. rst-class:: classref-method
  108. void **execute** **(** :ref:`float<class_float>` delta, :ref:`int<class_int>` execution_mode **)**
  109. Executes all of the :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ s in the stack that use the same execution mode as the passed-in ``execution_mode``, starting from index ``0`` to :ref:`modification_count<class_SkeletonModificationStack2D_property_modification_count>`.
  110. \ **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.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_SkeletonModificationStack2D_method_get_is_setup:
  114. .. rst-class:: classref-method
  115. :ref:`bool<class_bool>` **get_is_setup** **(** **)** |const|
  116. Returns a boolean that indicates whether the modification stack is setup and can execute.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_SkeletonModificationStack2D_method_get_modification:
  120. .. rst-class:: classref-method
  121. :ref:`SkeletonModification2D<class_SkeletonModification2D>` **get_modification** **(** :ref:`int<class_int>` mod_idx **)** |const|
  122. Returns the :ref:`SkeletonModification2D<class_SkeletonModification2D>` at the passed-in index, ``mod_idx``.
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _class_SkeletonModificationStack2D_method_get_skeleton:
  126. .. rst-class:: classref-method
  127. :ref:`Skeleton2D<class_Skeleton2D>` **get_skeleton** **(** **)** |const|
  128. Returns the :ref:`Skeleton2D<class_Skeleton2D>` node that the SkeletonModificationStack2D is bound to.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_SkeletonModificationStack2D_method_set_modification:
  132. .. rst-class:: classref-method
  133. void **set_modification** **(** :ref:`int<class_int>` mod_idx, :ref:`SkeletonModification2D<class_SkeletonModification2D>` modification **)**
  134. Sets the modification at ``mod_idx`` to the passed-in modification, ``modification``.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_SkeletonModificationStack2D_method_setup:
  138. .. rst-class:: classref-method
  139. void **setup** **(** **)**
  140. Sets up the modification stack so it can execute. This function should be called by :ref:`Skeleton2D<class_Skeleton2D>` and shouldn't be manually called unless you know what you are doing.
  141. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  142. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  143. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  144. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  145. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  146. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  147. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`