class_skeleton3d.rst 45 KB

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