class_skeletonmodifier3d.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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/SkeletonModifier3D.xml.
  6. .. _class_SkeletonModifier3D:
  7. SkeletonModifier3D
  8. ==================
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`BoneConstraint3D<class_BoneConstraint3D>`, :ref:`IKModifier3D<class_IKModifier3D>`, :ref:`LimitAngularVelocityModifier3D<class_LimitAngularVelocityModifier3D>`, :ref:`LookAtModifier3D<class_LookAtModifier3D>`, :ref:`ModifierBoneTarget3D<class_ModifierBoneTarget3D>`, :ref:`PhysicalBoneSimulator3D<class_PhysicalBoneSimulator3D>`, :ref:`RetargetModifier3D<class_RetargetModifier3D>`, :ref:`SkeletonIK3D<class_SkeletonIK3D>`, :ref:`SpringBoneSimulator3D<class_SpringBoneSimulator3D>`, :ref:`XRBodyModifier3D<class_XRBodyModifier3D>`, :ref:`XRHandModifier3D<class_XRHandModifier3D>`
  11. A node that may modify a Skeleton3D's bones.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. **SkeletonModifier3D** retrieves a target :ref:`Skeleton3D<class_Skeleton3D>` by having a :ref:`Skeleton3D<class_Skeleton3D>` parent.
  16. If there is an :ref:`AnimationMixer<class_AnimationMixer>`, a modification always performs after playback process of the :ref:`AnimationMixer<class_AnimationMixer>`.
  17. This node should be used to implement custom IK solvers, constraints, or skeleton physics.
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - `Design of the Skeleton Modifier 3D <https://godotengine.org/article/design-of-the-skeleton-modifier-3d/>`__
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +---------------------------+---------------------------------------------------------------+----------+
  28. | :ref:`bool<class_bool>` | :ref:`active<class_SkeletonModifier3D_property_active>` | ``true`` |
  29. +---------------------------+---------------------------------------------------------------+----------+
  30. | :ref:`float<class_float>` | :ref:`influence<class_SkeletonModifier3D_property_influence>` | ``1.0`` |
  31. +---------------------------+---------------------------------------------------------------+----------+
  32. .. rst-class:: classref-reftable-group
  33. Methods
  34. -------
  35. .. table::
  36. :widths: auto
  37. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | |void| | :ref:`_process_modification<class_SkeletonModifier3D_private_method__process_modification>`\ (\ ) |virtual| |
  39. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | |void| | :ref:`_process_modification_with_delta<class_SkeletonModifier3D_private_method__process_modification_with_delta>`\ (\ delta\: :ref:`float<class_float>`\ ) |virtual| |
  41. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | |void| | :ref:`_skeleton_changed<class_SkeletonModifier3D_private_method__skeleton_changed>`\ (\ old_skeleton\: :ref:`Skeleton3D<class_Skeleton3D>`, new_skeleton\: :ref:`Skeleton3D<class_Skeleton3D>`\ ) |virtual| |
  43. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | |void| | :ref:`_validate_bone_names<class_SkeletonModifier3D_private_method__validate_bone_names>`\ (\ ) |virtual| |
  45. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Skeleton3D<class_Skeleton3D>` | :ref:`get_skeleton<class_SkeletonModifier3D_method_get_skeleton>`\ (\ ) |const| |
  47. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. .. rst-class:: classref-section-separator
  49. ----
  50. .. rst-class:: classref-descriptions-group
  51. Signals
  52. -------
  53. .. _class_SkeletonModifier3D_signal_modification_processed:
  54. .. rst-class:: classref-signal
  55. **modification_processed**\ (\ ) :ref:`🔗<class_SkeletonModifier3D_signal_modification_processed>`
  56. Notifies when the modification have been finished.
  57. \ **Note:** If you want to get the modified bone pose by the modifier, you must use :ref:`Skeleton3D.get_bone_pose()<class_Skeleton3D_method_get_bone_pose>` or :ref:`Skeleton3D.get_bone_global_pose()<class_Skeleton3D_method_get_bone_global_pose>` at the moment this signal is fired.
  58. .. rst-class:: classref-section-separator
  59. ----
  60. .. rst-class:: classref-descriptions-group
  61. Enumerations
  62. ------------
  63. .. _enum_SkeletonModifier3D_BoneAxis:
  64. .. rst-class:: classref-enumeration
  65. enum **BoneAxis**: :ref:`🔗<enum_SkeletonModifier3D_BoneAxis>`
  66. .. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_X:
  67. .. rst-class:: classref-enumeration-constant
  68. :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_PLUS_X** = ``0``
  69. Enumerated value for the +X axis.
  70. .. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_X:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_MINUS_X** = ``1``
  73. Enumerated value for the -X axis.
  74. .. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_Y:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_PLUS_Y** = ``2``
  77. Enumerated value for the +Y axis.
  78. .. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_Y:
  79. .. rst-class:: classref-enumeration-constant
  80. :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_MINUS_Y** = ``3``
  81. Enumerated value for the -Y axis.
  82. .. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_Z:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_PLUS_Z** = ``4``
  85. Enumerated value for the +Z axis.
  86. .. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_Z:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_MINUS_Z** = ``5``
  89. Enumerated value for the -Z axis.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _enum_SkeletonModifier3D_BoneDirection:
  93. .. rst-class:: classref-enumeration
  94. enum **BoneDirection**: :ref:`🔗<enum_SkeletonModifier3D_BoneDirection>`
  95. .. _class_SkeletonModifier3D_constant_BONE_DIRECTION_PLUS_X:
  96. .. rst-class:: classref-enumeration-constant
  97. :ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_PLUS_X** = ``0``
  98. Enumerated value for the +X axis.
  99. .. _class_SkeletonModifier3D_constant_BONE_DIRECTION_MINUS_X:
  100. .. rst-class:: classref-enumeration-constant
  101. :ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_MINUS_X** = ``1``
  102. Enumerated value for the -X axis.
  103. .. _class_SkeletonModifier3D_constant_BONE_DIRECTION_PLUS_Y:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_PLUS_Y** = ``2``
  106. Enumerated value for the +Y axis.
  107. .. _class_SkeletonModifier3D_constant_BONE_DIRECTION_MINUS_Y:
  108. .. rst-class:: classref-enumeration-constant
  109. :ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_MINUS_Y** = ``3``
  110. Enumerated value for the -Y axis.
  111. .. _class_SkeletonModifier3D_constant_BONE_DIRECTION_PLUS_Z:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_PLUS_Z** = ``4``
  114. Enumerated value for the +Z axis.
  115. .. _class_SkeletonModifier3D_constant_BONE_DIRECTION_MINUS_Z:
  116. .. rst-class:: classref-enumeration-constant
  117. :ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_MINUS_Z** = ``5``
  118. Enumerated value for the -Z axis.
  119. .. _class_SkeletonModifier3D_constant_BONE_DIRECTION_FROM_PARENT:
  120. .. rst-class:: classref-enumeration-constant
  121. :ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_FROM_PARENT** = ``6``
  122. Enumerated value for the axis from a parent bone to the child bone.
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _enum_SkeletonModifier3D_SecondaryDirection:
  126. .. rst-class:: classref-enumeration
  127. enum **SecondaryDirection**: :ref:`🔗<enum_SkeletonModifier3D_SecondaryDirection>`
  128. .. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_NONE:
  129. .. rst-class:: classref-enumeration-constant
  130. :ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_NONE** = ``0``
  131. Enumerated value for the case when the axis is undefined.
  132. .. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_PLUS_X:
  133. .. rst-class:: classref-enumeration-constant
  134. :ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_PLUS_X** = ``1``
  135. Enumerated value for the +X axis.
  136. .. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_MINUS_X:
  137. .. rst-class:: classref-enumeration-constant
  138. :ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_MINUS_X** = ``2``
  139. Enumerated value for the -X axis.
  140. .. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_PLUS_Y:
  141. .. rst-class:: classref-enumeration-constant
  142. :ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_PLUS_Y** = ``3``
  143. Enumerated value for the +Y axis.
  144. .. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_MINUS_Y:
  145. .. rst-class:: classref-enumeration-constant
  146. :ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_MINUS_Y** = ``4``
  147. Enumerated value for the -Y axis.
  148. .. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_PLUS_Z:
  149. .. rst-class:: classref-enumeration-constant
  150. :ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_PLUS_Z** = ``5``
  151. Enumerated value for the +Z axis.
  152. .. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_MINUS_Z:
  153. .. rst-class:: classref-enumeration-constant
  154. :ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_MINUS_Z** = ``6``
  155. Enumerated value for the -Z axis.
  156. .. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_CUSTOM:
  157. .. rst-class:: classref-enumeration-constant
  158. :ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_CUSTOM** = ``7``
  159. Enumerated value for an optional axis.
  160. .. rst-class:: classref-item-separator
  161. ----
  162. .. _enum_SkeletonModifier3D_RotationAxis:
  163. .. rst-class:: classref-enumeration
  164. enum **RotationAxis**: :ref:`🔗<enum_SkeletonModifier3D_RotationAxis>`
  165. .. _class_SkeletonModifier3D_constant_ROTATION_AXIS_X:
  166. .. rst-class:: classref-enumeration-constant
  167. :ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_X** = ``0``
  168. Enumerated value for the rotation of the X axis.
  169. .. _class_SkeletonModifier3D_constant_ROTATION_AXIS_Y:
  170. .. rst-class:: classref-enumeration-constant
  171. :ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_Y** = ``1``
  172. Enumerated value for the rotation of the Y axis.
  173. .. _class_SkeletonModifier3D_constant_ROTATION_AXIS_Z:
  174. .. rst-class:: classref-enumeration-constant
  175. :ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_Z** = ``2``
  176. Enumerated value for the rotation of the Z axis.
  177. .. _class_SkeletonModifier3D_constant_ROTATION_AXIS_ALL:
  178. .. rst-class:: classref-enumeration-constant
  179. :ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_ALL** = ``3``
  180. Enumerated value for the unconstrained rotation.
  181. .. _class_SkeletonModifier3D_constant_ROTATION_AXIS_CUSTOM:
  182. .. rst-class:: classref-enumeration-constant
  183. :ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_CUSTOM** = ``4``
  184. Enumerated value for an optional rotation axis.
  185. .. rst-class:: classref-section-separator
  186. ----
  187. .. rst-class:: classref-descriptions-group
  188. Property Descriptions
  189. ---------------------
  190. .. _class_SkeletonModifier3D_property_active:
  191. .. rst-class:: classref-property
  192. :ref:`bool<class_bool>` **active** = ``true`` :ref:`🔗<class_SkeletonModifier3D_property_active>`
  193. .. rst-class:: classref-property-setget
  194. - |void| **set_active**\ (\ value\: :ref:`bool<class_bool>`\ )
  195. - :ref:`bool<class_bool>` **is_active**\ (\ )
  196. If ``true``, the **SkeletonModifier3D** will be processing.
  197. .. rst-class:: classref-item-separator
  198. ----
  199. .. _class_SkeletonModifier3D_property_influence:
  200. .. rst-class:: classref-property
  201. :ref:`float<class_float>` **influence** = ``1.0`` :ref:`🔗<class_SkeletonModifier3D_property_influence>`
  202. .. rst-class:: classref-property-setget
  203. - |void| **set_influence**\ (\ value\: :ref:`float<class_float>`\ )
  204. - :ref:`float<class_float>` **get_influence**\ (\ )
  205. Sets the influence of the modification.
  206. \ **Note:** This value is used by :ref:`Skeleton3D<class_Skeleton3D>` to blend, so the **SkeletonModifier3D** should always apply only 100% of the result without interpolation.
  207. .. rst-class:: classref-section-separator
  208. ----
  209. .. rst-class:: classref-descriptions-group
  210. Method Descriptions
  211. -------------------
  212. .. _class_SkeletonModifier3D_private_method__process_modification:
  213. .. rst-class:: classref-method
  214. |void| **_process_modification**\ (\ ) |virtual| :ref:`🔗<class_SkeletonModifier3D_private_method__process_modification>`
  215. **Deprecated:** Use :ref:`_process_modification_with_delta()<class_SkeletonModifier3D_private_method__process_modification_with_delta>` instead.
  216. Override this virtual method to implement a custom skeleton modifier. You should do things like get the :ref:`Skeleton3D<class_Skeleton3D>`'s current pose and apply the pose here.
  217. \ :ref:`_process_modification()<class_SkeletonModifier3D_private_method__process_modification>` must not apply :ref:`influence<class_SkeletonModifier3D_property_influence>` to bone poses because the :ref:`Skeleton3D<class_Skeleton3D>` automatically applies influence to all bone poses set by the modifier.
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_SkeletonModifier3D_private_method__process_modification_with_delta:
  221. .. rst-class:: classref-method
  222. |void| **_process_modification_with_delta**\ (\ delta\: :ref:`float<class_float>`\ ) |virtual| :ref:`🔗<class_SkeletonModifier3D_private_method__process_modification_with_delta>`
  223. Override this virtual method to implement a custom skeleton modifier. You should do things like get the :ref:`Skeleton3D<class_Skeleton3D>`'s current pose and apply the pose here.
  224. \ :ref:`_process_modification_with_delta()<class_SkeletonModifier3D_private_method__process_modification_with_delta>` must not apply :ref:`influence<class_SkeletonModifier3D_property_influence>` to bone poses because the :ref:`Skeleton3D<class_Skeleton3D>` automatically applies influence to all bone poses set by the modifier.
  225. \ ``delta`` is passed from parent :ref:`Skeleton3D<class_Skeleton3D>`. See also :ref:`Skeleton3D.advance()<class_Skeleton3D_method_advance>`.
  226. .. rst-class:: classref-item-separator
  227. ----
  228. .. _class_SkeletonModifier3D_private_method__skeleton_changed:
  229. .. rst-class:: classref-method
  230. |void| **_skeleton_changed**\ (\ old_skeleton\: :ref:`Skeleton3D<class_Skeleton3D>`, new_skeleton\: :ref:`Skeleton3D<class_Skeleton3D>`\ ) |virtual| :ref:`🔗<class_SkeletonModifier3D_private_method__skeleton_changed>`
  231. Called when the skeleton is changed.
  232. .. rst-class:: classref-item-separator
  233. ----
  234. .. _class_SkeletonModifier3D_private_method__validate_bone_names:
  235. .. rst-class:: classref-method
  236. |void| **_validate_bone_names**\ (\ ) |virtual| :ref:`🔗<class_SkeletonModifier3D_private_method__validate_bone_names>`
  237. Called when bone name and index need to be validated such as the timing of the entering tree or changing skeleton.
  238. .. rst-class:: classref-item-separator
  239. ----
  240. .. _class_SkeletonModifier3D_method_get_skeleton:
  241. .. rst-class:: classref-method
  242. :ref:`Skeleton3D<class_Skeleton3D>` **get_skeleton**\ (\ ) |const| :ref:`🔗<class_SkeletonModifier3D_method_get_skeleton>`
  243. Get parent :ref:`Skeleton3D<class_Skeleton3D>` node if found.
  244. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  245. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  246. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  247. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  248. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  249. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  250. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  251. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  252. .. |void| replace:: :abbr:`void (No return value.)`