class_skeleton3d.rst 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  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/Skeleton3D.xml.
  6. .. _class_Skeleton3D:
  7. Skeleton3D
  8. ==========
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A node containing a bone hierarchy, used to create a 3D skeletal animation.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **Skeleton3D** provides an interface for managing a hierarchy of bones, including pose, rest and animation (see :ref:`Animation<class_Animation>`). It can also use ragdoll physics.
  15. The overall transform of a bone with respect to the skeleton is determined by bone pose. Bone rest defines the initial transform of the bone pose.
  16. Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it is not the actual global/world transform of the bone.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - `3D Inverse Kinematics Demo <https://godotengine.org/asset-library/asset/523>`__
  21. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +---------------------------+---------------------------------------------------------------------------------+-----------+
  28. | :ref:`bool<class_bool>` | :ref:`animate_physical_bones<class_Skeleton3D_property_animate_physical_bones>` | ``true`` |
  29. +---------------------------+---------------------------------------------------------------------------------+-----------+
  30. | :ref:`float<class_float>` | :ref:`motion_scale<class_Skeleton3D_property_motion_scale>` | ``1.0`` |
  31. +---------------------------+---------------------------------------------------------------------------------+-----------+
  32. | :ref:`bool<class_bool>` | :ref:`show_rest_only<class_Skeleton3D_property_show_rest_only>` | ``false`` |
  33. +---------------------------+---------------------------------------------------------------------------------+-----------+
  34. .. rst-class:: classref-reftable-group
  35. Methods
  36. -------
  37. .. table::
  38. :widths: auto
  39. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`add_bone<class_Skeleton3D_method_add_bone>`\ (\ name\: :ref:`String<class_String>`\ ) |
  41. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | |void| | :ref:`clear_bones<class_Skeleton3D_method_clear_bones>`\ (\ ) |
  43. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | |void| | :ref:`clear_bones_global_pose_override<class_Skeleton3D_method_clear_bones_global_pose_override>`\ (\ ) |
  45. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Skin<class_Skin>` | :ref:`create_skin_from_rest_transforms<class_Skeleton3D_method_create_skin_from_rest_transforms>`\ (\ ) |
  47. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`int<class_int>` | :ref:`find_bone<class_Skeleton3D_method_find_bone>`\ (\ name\: :ref:`String<class_String>`\ ) |const| |
  49. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | |void| | :ref:`force_update_all_bone_transforms<class_Skeleton3D_method_force_update_all_bone_transforms>`\ (\ ) |
  51. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | |void| | :ref:`force_update_bone_child_transform<class_Skeleton3D_method_force_update_bone_child_transform>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |
  53. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_bone_children<class_Skeleton3D_method_get_bone_children>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  55. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_bone_count<class_Skeleton3D_method_get_bone_count>`\ (\ ) |const| |
  57. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_pose<class_Skeleton3D_method_get_bone_global_pose>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  59. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_pose_no_override<class_Skeleton3D_method_get_bone_global_pose_no_override>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  61. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_pose_override<class_Skeleton3D_method_get_bone_global_pose_override>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  63. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_rest<class_Skeleton3D_method_get_bone_global_rest>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  65. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`String<class_String>` | :ref:`get_bone_name<class_Skeleton3D_method_get_bone_name>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  67. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`int<class_int>` | :ref:`get_bone_parent<class_Skeleton3D_method_get_bone_parent>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  69. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_pose<class_Skeleton3D_method_get_bone_pose>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  71. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Vector3<class_Vector3>` | :ref:`get_bone_pose_position<class_Skeleton3D_method_get_bone_pose_position>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  73. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Quaternion<class_Quaternion>` | :ref:`get_bone_pose_rotation<class_Skeleton3D_method_get_bone_pose_rotation>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  75. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Vector3<class_Vector3>` | :ref:`get_bone_pose_scale<class_Skeleton3D_method_get_bone_pose_scale>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  77. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_rest<class_Skeleton3D_method_get_bone_rest>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  79. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_parentless_bones<class_Skeleton3D_method_get_parentless_bones>`\ (\ ) |const| |
  81. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`get_version<class_Skeleton3D_method_get_version>`\ (\ ) |const| |
  83. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`is_bone_enabled<class_Skeleton3D_method_is_bone_enabled>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const| |
  85. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | |void| | :ref:`localize_rests<class_Skeleton3D_method_localize_rests>`\ (\ ) |
  87. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | |void| | :ref:`physical_bones_add_collision_exception<class_Skeleton3D_method_physical_bones_add_collision_exception>`\ (\ exception\: :ref:`RID<class_RID>`\ ) |
  89. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | |void| | :ref:`physical_bones_remove_collision_exception<class_Skeleton3D_method_physical_bones_remove_collision_exception>`\ (\ exception\: :ref:`RID<class_RID>`\ ) |
  91. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | |void| | :ref:`physical_bones_start_simulation<class_Skeleton3D_method_physical_bones_start_simulation>`\ (\ bones\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) |
  93. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | |void| | :ref:`physical_bones_stop_simulation<class_Skeleton3D_method_physical_bones_stop_simulation>`\ (\ ) |
  95. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`SkinReference<class_SkinReference>` | :ref:`register_skin<class_Skeleton3D_method_register_skin>`\ (\ skin\: :ref:`Skin<class_Skin>`\ ) |
  97. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | |void| | :ref:`reset_bone_pose<class_Skeleton3D_method_reset_bone_pose>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |
  99. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | |void| | :ref:`reset_bone_poses<class_Skeleton3D_method_reset_bone_poses>`\ (\ ) |
  101. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | |void| | :ref:`set_bone_enabled<class_Skeleton3D_method_set_bone_enabled>`\ (\ bone_idx\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>` = true\ ) |
  103. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | |void| | :ref:`set_bone_global_pose_override<class_Skeleton3D_method_set_bone_global_pose_override>`\ (\ bone_idx\: :ref:`int<class_int>`, pose\: :ref:`Transform3D<class_Transform3D>`, amount\: :ref:`float<class_float>`, persistent\: :ref:`bool<class_bool>` = false\ ) |
  105. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | |void| | :ref:`set_bone_name<class_Skeleton3D_method_set_bone_name>`\ (\ bone_idx\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
  107. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | |void| | :ref:`set_bone_parent<class_Skeleton3D_method_set_bone_parent>`\ (\ bone_idx\: :ref:`int<class_int>`, parent_idx\: :ref:`int<class_int>`\ ) |
  109. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | |void| | :ref:`set_bone_pose_position<class_Skeleton3D_method_set_bone_pose_position>`\ (\ bone_idx\: :ref:`int<class_int>`, position\: :ref:`Vector3<class_Vector3>`\ ) |
  111. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | |void| | :ref:`set_bone_pose_rotation<class_Skeleton3D_method_set_bone_pose_rotation>`\ (\ bone_idx\: :ref:`int<class_int>`, rotation\: :ref:`Quaternion<class_Quaternion>`\ ) |
  113. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | |void| | :ref:`set_bone_pose_scale<class_Skeleton3D_method_set_bone_pose_scale>`\ (\ bone_idx\: :ref:`int<class_int>`, scale\: :ref:`Vector3<class_Vector3>`\ ) |
  115. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | |void| | :ref:`set_bone_rest<class_Skeleton3D_method_set_bone_rest>`\ (\ bone_idx\: :ref:`int<class_int>`, rest\: :ref:`Transform3D<class_Transform3D>`\ ) |
  117. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | |void| | :ref:`unparent_bone_and_rest<class_Skeleton3D_method_unparent_bone_and_rest>`\ (\ bone_idx\: :ref:`int<class_int>`\ ) |
  119. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. .. rst-class:: classref-section-separator
  121. ----
  122. .. rst-class:: classref-descriptions-group
  123. Signals
  124. -------
  125. .. _class_Skeleton3D_signal_bone_enabled_changed:
  126. .. rst-class:: classref-signal
  127. **bone_enabled_changed**\ (\ bone_idx\: :ref:`int<class_int>`\ )
  128. Emitted when the bone at ``bone_idx`` is toggled with :ref:`set_bone_enabled<class_Skeleton3D_method_set_bone_enabled>`. Use :ref:`is_bone_enabled<class_Skeleton3D_method_is_bone_enabled>` to check the new value.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_Skeleton3D_signal_bone_pose_changed:
  132. .. rst-class:: classref-signal
  133. **bone_pose_changed**\ (\ bone_idx\: :ref:`int<class_int>`\ )
  134. Emitted when the bone at ``bone_idx`` changes its transform/pose. This can be used to update other nodes that rely on bone positions.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_Skeleton3D_signal_pose_updated:
  138. .. rst-class:: classref-signal
  139. **pose_updated**\ (\ )
  140. Emitted when the pose is updated, after :ref:`NOTIFICATION_UPDATE_SKELETON<class_Skeleton3D_constant_NOTIFICATION_UPDATE_SKELETON>` is received.
  141. .. rst-class:: classref-item-separator
  142. ----
  143. .. _class_Skeleton3D_signal_show_rest_only_changed:
  144. .. rst-class:: classref-signal
  145. **show_rest_only_changed**\ (\ )
  146. Emitted when the value of :ref:`show_rest_only<class_Skeleton3D_property_show_rest_only>` changes.
  147. .. rst-class:: classref-section-separator
  148. ----
  149. .. rst-class:: classref-descriptions-group
  150. Constants
  151. ---------
  152. .. _class_Skeleton3D_constant_NOTIFICATION_UPDATE_SKELETON:
  153. .. rst-class:: classref-constant
  154. **NOTIFICATION_UPDATE_SKELETON** = ``50``
  155. Notification received when this skeleton's pose needs to be updated.
  156. This notification is received *before* the related :ref:`pose_updated<class_Skeleton3D_signal_pose_updated>` signal.
  157. .. rst-class:: classref-section-separator
  158. ----
  159. .. rst-class:: classref-descriptions-group
  160. Property Descriptions
  161. ---------------------
  162. .. _class_Skeleton3D_property_animate_physical_bones:
  163. .. rst-class:: classref-property
  164. :ref:`bool<class_bool>` **animate_physical_bones** = ``true``
  165. .. rst-class:: classref-property-setget
  166. - |void| **set_animate_physical_bones**\ (\ value\: :ref:`bool<class_bool>`\ )
  167. - :ref:`bool<class_bool>` **get_animate_physical_bones**\ (\ )
  168. .. container:: contribute
  169. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_Skeleton3D_property_motion_scale:
  173. .. rst-class:: classref-property
  174. :ref:`float<class_float>` **motion_scale** = ``1.0``
  175. .. rst-class:: classref-property-setget
  176. - |void| **set_motion_scale**\ (\ value\: :ref:`float<class_float>`\ )
  177. - :ref:`float<class_float>` **get_motion_scale**\ (\ )
  178. Multiplies the 3D position track animation.
  179. \ **Note:** Unless this value is ``1.0``, the key value in animation will not match the actual position value.
  180. .. rst-class:: classref-item-separator
  181. ----
  182. .. _class_Skeleton3D_property_show_rest_only:
  183. .. rst-class:: classref-property
  184. :ref:`bool<class_bool>` **show_rest_only** = ``false``
  185. .. rst-class:: classref-property-setget
  186. - |void| **set_show_rest_only**\ (\ value\: :ref:`bool<class_bool>`\ )
  187. - :ref:`bool<class_bool>` **is_show_rest_only**\ (\ )
  188. If ``true``, forces the bones in their default rest pose, regardless of their values. In the editor, this also prevents the bones from being edited.
  189. .. rst-class:: classref-section-separator
  190. ----
  191. .. rst-class:: classref-descriptions-group
  192. Method Descriptions
  193. -------------------
  194. .. _class_Skeleton3D_method_add_bone:
  195. .. rst-class:: classref-method
  196. :ref:`int<class_int>` **add_bone**\ (\ name\: :ref:`String<class_String>`\ )
  197. Adds a new bone with the given name. Returns the new bone's index, or ``-1`` if this method fails.
  198. \ **Note:** Bone names should be unique, non empty, and cannot include the ``:`` and ``/`` characters.
  199. .. rst-class:: classref-item-separator
  200. ----
  201. .. _class_Skeleton3D_method_clear_bones:
  202. .. rst-class:: classref-method
  203. |void| **clear_bones**\ (\ )
  204. Clear all the bones in this skeleton.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_Skeleton3D_method_clear_bones_global_pose_override:
  208. .. rst-class:: classref-method
  209. |void| **clear_bones_global_pose_override**\ (\ )
  210. Removes the global pose override on all bones in the skeleton.
  211. .. rst-class:: classref-item-separator
  212. ----
  213. .. _class_Skeleton3D_method_create_skin_from_rest_transforms:
  214. .. rst-class:: classref-method
  215. :ref:`Skin<class_Skin>` **create_skin_from_rest_transforms**\ (\ )
  216. .. container:: contribute
  217. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_Skeleton3D_method_find_bone:
  221. .. rst-class:: classref-method
  222. :ref:`int<class_int>` **find_bone**\ (\ name\: :ref:`String<class_String>`\ ) |const|
  223. Returns the bone index that matches ``name`` as its name.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_Skeleton3D_method_force_update_all_bone_transforms:
  227. .. rst-class:: classref-method
  228. |void| **force_update_all_bone_transforms**\ (\ )
  229. **Deprecated:** This method should only be called internally.
  230. Force updates the bone transforms/poses for all bones in the skeleton.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_Skeleton3D_method_force_update_bone_child_transform:
  234. .. rst-class:: classref-method
  235. |void| **force_update_bone_child_transform**\ (\ bone_idx\: :ref:`int<class_int>`\ )
  236. Force updates the bone transform for the bone at ``bone_idx`` and all of its children.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_Skeleton3D_method_get_bone_children:
  240. .. rst-class:: classref-method
  241. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_bone_children**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  242. Returns an array containing the bone indexes of all the child node of the passed in bone, ``bone_idx``.
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_Skeleton3D_method_get_bone_count:
  246. .. rst-class:: classref-method
  247. :ref:`int<class_int>` **get_bone_count**\ (\ ) |const|
  248. Returns the number of bones in the skeleton.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_Skeleton3D_method_get_bone_global_pose:
  252. .. rst-class:: classref-method
  253. :ref:`Transform3D<class_Transform3D>` **get_bone_global_pose**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  254. Returns the overall transform of the specified bone, with respect to the skeleton. Being relative to the skeleton frame, this is not the actual "global" transform of the bone.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_Skeleton3D_method_get_bone_global_pose_no_override:
  258. .. rst-class:: classref-method
  259. :ref:`Transform3D<class_Transform3D>` **get_bone_global_pose_no_override**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  260. Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_Skeleton3D_method_get_bone_global_pose_override:
  264. .. rst-class:: classref-method
  265. :ref:`Transform3D<class_Transform3D>` **get_bone_global_pose_override**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  266. Returns the global pose override transform for ``bone_idx``.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_Skeleton3D_method_get_bone_global_rest:
  270. .. rst-class:: classref-method
  271. :ref:`Transform3D<class_Transform3D>` **get_bone_global_rest**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  272. Returns the global rest transform for ``bone_idx``.
  273. .. rst-class:: classref-item-separator
  274. ----
  275. .. _class_Skeleton3D_method_get_bone_name:
  276. .. rst-class:: classref-method
  277. :ref:`String<class_String>` **get_bone_name**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  278. Returns the name of the bone at index ``bone_idx``.
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_Skeleton3D_method_get_bone_parent:
  282. .. rst-class:: classref-method
  283. :ref:`int<class_int>` **get_bone_parent**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  284. Returns the bone index which is the parent of the bone at ``bone_idx``. If -1, then bone has no parent.
  285. \ **Note:** The parent bone returned will always be less than ``bone_idx``.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_Skeleton3D_method_get_bone_pose:
  289. .. rst-class:: classref-method
  290. :ref:`Transform3D<class_Transform3D>` **get_bone_pose**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  291. Returns the pose transform of the specified bone.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_Skeleton3D_method_get_bone_pose_position:
  295. .. rst-class:: classref-method
  296. :ref:`Vector3<class_Vector3>` **get_bone_pose_position**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  297. Returns the pose position of the bone at ``bone_idx``. The returned :ref:`Vector3<class_Vector3>` is in the local coordinate space of the **Skeleton3D** node.
  298. .. rst-class:: classref-item-separator
  299. ----
  300. .. _class_Skeleton3D_method_get_bone_pose_rotation:
  301. .. rst-class:: classref-method
  302. :ref:`Quaternion<class_Quaternion>` **get_bone_pose_rotation**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  303. Returns the pose rotation of the bone at ``bone_idx``. The returned :ref:`Quaternion<class_Quaternion>` is local to the bone with respect to the rotation of any parent bones.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_Skeleton3D_method_get_bone_pose_scale:
  307. .. rst-class:: classref-method
  308. :ref:`Vector3<class_Vector3>` **get_bone_pose_scale**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  309. Returns the pose scale of the bone at ``bone_idx``.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_Skeleton3D_method_get_bone_rest:
  313. .. rst-class:: classref-method
  314. :ref:`Transform3D<class_Transform3D>` **get_bone_rest**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  315. Returns the rest transform for a bone ``bone_idx``.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_Skeleton3D_method_get_parentless_bones:
  319. .. rst-class:: classref-method
  320. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_parentless_bones**\ (\ ) |const|
  321. Returns an array with all of the bones that are parentless. Another way to look at this is that it returns the indexes of all the bones that are not dependent or modified by other bones in the Skeleton.
  322. .. rst-class:: classref-item-separator
  323. ----
  324. .. _class_Skeleton3D_method_get_version:
  325. .. rst-class:: classref-method
  326. :ref:`int<class_int>` **get_version**\ (\ ) |const|
  327. Returns the number of times the bone hierarchy has changed within this skeleton, including renames.
  328. The Skeleton version is not serialized: only use within a single instance of Skeleton3D.
  329. Use for invalidating caches in IK solvers and other nodes which process bones.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_Skeleton3D_method_is_bone_enabled:
  333. .. rst-class:: classref-method
  334. :ref:`bool<class_bool>` **is_bone_enabled**\ (\ bone_idx\: :ref:`int<class_int>`\ ) |const|
  335. Returns whether the bone pose for the bone at ``bone_idx`` is enabled.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_Skeleton3D_method_localize_rests:
  339. .. rst-class:: classref-method
  340. |void| **localize_rests**\ (\ )
  341. Returns all bones in the skeleton to their rest poses.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_Skeleton3D_method_physical_bones_add_collision_exception:
  345. .. rst-class:: classref-method
  346. |void| **physical_bones_add_collision_exception**\ (\ exception\: :ref:`RID<class_RID>`\ )
  347. Adds a collision exception to the physical bone.
  348. Works just like the :ref:`RigidBody3D<class_RigidBody3D>` node.
  349. .. rst-class:: classref-item-separator
  350. ----
  351. .. _class_Skeleton3D_method_physical_bones_remove_collision_exception:
  352. .. rst-class:: classref-method
  353. |void| **physical_bones_remove_collision_exception**\ (\ exception\: :ref:`RID<class_RID>`\ )
  354. Removes a collision exception to the physical bone.
  355. Works just like the :ref:`RigidBody3D<class_RigidBody3D>` node.
  356. .. rst-class:: classref-item-separator
  357. ----
  358. .. _class_Skeleton3D_method_physical_bones_start_simulation:
  359. .. rst-class:: classref-method
  360. |void| **physical_bones_start_simulation**\ (\ bones\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ )
  361. Tells the :ref:`PhysicalBone3D<class_PhysicalBone3D>` nodes in the Skeleton to start simulating and reacting to the physics world.
  362. Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated.
  363. .. rst-class:: classref-item-separator
  364. ----
  365. .. _class_Skeleton3D_method_physical_bones_stop_simulation:
  366. .. rst-class:: classref-method
  367. |void| **physical_bones_stop_simulation**\ (\ )
  368. Tells the :ref:`PhysicalBone3D<class_PhysicalBone3D>` nodes in the Skeleton to stop simulating.
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _class_Skeleton3D_method_register_skin:
  372. .. rst-class:: classref-method
  373. :ref:`SkinReference<class_SkinReference>` **register_skin**\ (\ skin\: :ref:`Skin<class_Skin>`\ )
  374. Binds the given Skin to the Skeleton.
  375. .. rst-class:: classref-item-separator
  376. ----
  377. .. _class_Skeleton3D_method_reset_bone_pose:
  378. .. rst-class:: classref-method
  379. |void| **reset_bone_pose**\ (\ bone_idx\: :ref:`int<class_int>`\ )
  380. Sets the bone pose to rest for ``bone_idx``.
  381. .. rst-class:: classref-item-separator
  382. ----
  383. .. _class_Skeleton3D_method_reset_bone_poses:
  384. .. rst-class:: classref-method
  385. |void| **reset_bone_poses**\ (\ )
  386. Sets all bone poses to rests.
  387. .. rst-class:: classref-item-separator
  388. ----
  389. .. _class_Skeleton3D_method_set_bone_enabled:
  390. .. rst-class:: classref-method
  391. |void| **set_bone_enabled**\ (\ bone_idx\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>` = true\ )
  392. Disables the pose for the bone at ``bone_idx`` if ``false``, enables the bone pose if ``true``.
  393. .. rst-class:: classref-item-separator
  394. ----
  395. .. _class_Skeleton3D_method_set_bone_global_pose_override:
  396. .. rst-class:: classref-method
  397. |void| **set_bone_global_pose_override**\ (\ bone_idx\: :ref:`int<class_int>`, pose\: :ref:`Transform3D<class_Transform3D>`, amount\: :ref:`float<class_float>`, persistent\: :ref:`bool<class_bool>` = false\ )
  398. Sets the global pose transform, ``pose``, for the bone at ``bone_idx``.
  399. \ ``amount`` is the interpolation strength that will be used when applying the pose, and ``persistent`` determines if the applied pose will remain.
  400. \ **Note:** The pose transform needs to be a global pose! To convert a world transform from a :ref:`Node3D<class_Node3D>` to a global bone pose, multiply the :ref:`Transform3D.affine_inverse<class_Transform3D_method_affine_inverse>` of the node's :ref:`Node3D.global_transform<class_Node3D_property_global_transform>` by the desired world transform.
  401. .. rst-class:: classref-item-separator
  402. ----
  403. .. _class_Skeleton3D_method_set_bone_name:
  404. .. rst-class:: classref-method
  405. |void| **set_bone_name**\ (\ bone_idx\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ )
  406. .. container:: contribute
  407. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_Skeleton3D_method_set_bone_parent:
  411. .. rst-class:: classref-method
  412. |void| **set_bone_parent**\ (\ bone_idx\: :ref:`int<class_int>`, parent_idx\: :ref:`int<class_int>`\ )
  413. Sets the bone index ``parent_idx`` as the parent of the bone at ``bone_idx``. If -1, then bone has no parent.
  414. \ **Note:** ``parent_idx`` must be less than ``bone_idx``.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _class_Skeleton3D_method_set_bone_pose_position:
  418. .. rst-class:: classref-method
  419. |void| **set_bone_pose_position**\ (\ bone_idx\: :ref:`int<class_int>`, position\: :ref:`Vector3<class_Vector3>`\ )
  420. Sets the pose position of the bone at ``bone_idx`` to ``position``. ``position`` is a :ref:`Vector3<class_Vector3>` describing a position local to the **Skeleton3D** node.
  421. .. rst-class:: classref-item-separator
  422. ----
  423. .. _class_Skeleton3D_method_set_bone_pose_rotation:
  424. .. rst-class:: classref-method
  425. |void| **set_bone_pose_rotation**\ (\ bone_idx\: :ref:`int<class_int>`, rotation\: :ref:`Quaternion<class_Quaternion>`\ )
  426. Sets the pose rotation of the bone at ``bone_idx`` to ``rotation``. ``rotation`` is a :ref:`Quaternion<class_Quaternion>` describing a rotation in the bone's local coordinate space with respect to the rotation of any parent bones.
  427. .. rst-class:: classref-item-separator
  428. ----
  429. .. _class_Skeleton3D_method_set_bone_pose_scale:
  430. .. rst-class:: classref-method
  431. |void| **set_bone_pose_scale**\ (\ bone_idx\: :ref:`int<class_int>`, scale\: :ref:`Vector3<class_Vector3>`\ )
  432. Sets the pose scale of the bone at ``bone_idx`` to ``scale``.
  433. .. rst-class:: classref-item-separator
  434. ----
  435. .. _class_Skeleton3D_method_set_bone_rest:
  436. .. rst-class:: classref-method
  437. |void| **set_bone_rest**\ (\ bone_idx\: :ref:`int<class_int>`, rest\: :ref:`Transform3D<class_Transform3D>`\ )
  438. Sets the rest transform for bone ``bone_idx``.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _class_Skeleton3D_method_unparent_bone_and_rest:
  442. .. rst-class:: classref-method
  443. |void| **unparent_bone_and_rest**\ (\ bone_idx\: :ref:`int<class_int>`\ )
  444. Unparents the bone at ``bone_idx`` and sets its rest position to that of its parent prior to being reset.
  445. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  446. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  447. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  448. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  449. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  450. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  451. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  452. .. |void| replace:: :abbr:`void (No return value.)`