Files
godot-docs/classes/class_skeleton3d.rst
2023-07-24 10:19:37 +00:00

808 lines
45 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/Skeleton3D.xml.
.. _class_Skeleton3D:
Skeleton3D
==========
**Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
A node containing a bone hierarchy, used to create a 3D skeletal animation.
.. rst-class:: classref-introduction-group
Description
-----------
**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.
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.
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.
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.
.. rst-class:: classref-introduction-group
Tutorials
---------
- `3D Inverse Kinematics Demo <https://godotengine.org/asset-library/asset/523>`__
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+---------------------------+---------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`animate_physical_bones<class_Skeleton3D_property_animate_physical_bones>` | ``true`` |
+---------------------------+---------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`motion_scale<class_Skeleton3D_property_motion_scale>` | ``1.0`` |
+---------------------------+---------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`show_rest_only<class_Skeleton3D_property_show_rest_only>` | ``false`` |
+---------------------------+---------------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_bone<class_Skeleton3D_method_add_bone>` **(** :ref:`String<class_String>` name **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_bones<class_Skeleton3D_method_clear_bones>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_bones_global_pose_override<class_Skeleton3D_method_clear_bones_global_pose_override>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Skin<class_Skin>` | :ref:`create_skin_from_rest_transforms<class_Skeleton3D_method_create_skin_from_rest_transforms>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find_bone<class_Skeleton3D_method_find_bone>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`force_update_all_bone_transforms<class_Skeleton3D_method_force_update_all_bone_transforms>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`force_update_bone_child_transform<class_Skeleton3D_method_force_update_bone_child_transform>` **(** :ref:`int<class_int>` bone_idx **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_bone_children<class_Skeleton3D_method_get_bone_children>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bone_count<class_Skeleton3D_method_get_bone_count>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_pose<class_Skeleton3D_method_get_bone_global_pose>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_rest<class_Skeleton3D_method_get_bone_global_rest>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_bone_name<class_Skeleton3D_method_get_bone_name>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bone_parent<class_Skeleton3D_method_get_bone_parent>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_pose<class_Skeleton3D_method_get_bone_pose>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_bone_pose_position<class_Skeleton3D_method_get_bone_pose_position>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Quaternion<class_Quaternion>` | :ref:`get_bone_pose_rotation<class_Skeleton3D_method_get_bone_pose_rotation>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_bone_pose_scale<class_Skeleton3D_method_get_bone_pose_scale>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_rest<class_Skeleton3D_method_get_bone_rest>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_parentless_bones<class_Skeleton3D_method_get_parentless_bones>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_version<class_Skeleton3D_method_get_version>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bone_enabled<class_Skeleton3D_method_is_bone_enabled>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`localize_rests<class_Skeleton3D_method_localize_rests>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`physical_bones_add_collision_exception<class_Skeleton3D_method_physical_bones_add_collision_exception>` **(** :ref:`RID<class_RID>` exception **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`physical_bones_remove_collision_exception<class_Skeleton3D_method_physical_bones_remove_collision_exception>` **(** :ref:`RID<class_RID>` exception **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`physical_bones_start_simulation<class_Skeleton3D_method_physical_bones_start_simulation>` **(** :ref:`StringName[]<class_StringName>` bones=[] **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`physical_bones_stop_simulation<class_Skeleton3D_method_physical_bones_stop_simulation>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`SkinReference<class_SkinReference>` | :ref:`register_skin<class_Skeleton3D_method_register_skin>` **(** :ref:`Skin<class_Skin>` skin **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reset_bone_pose<class_Skeleton3D_method_reset_bone_pose>` **(** :ref:`int<class_int>` bone_idx **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reset_bone_poses<class_Skeleton3D_method_reset_bone_poses>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bone_enabled<class_Skeleton3D_method_set_bone_enabled>` **(** :ref:`int<class_int>` bone_idx, :ref:`bool<class_bool>` enabled=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 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 **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bone_name<class_Skeleton3D_method_set_bone_name>` **(** :ref:`int<class_int>` bone_idx, :ref:`String<class_String>` name **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bone_parent<class_Skeleton3D_method_set_bone_parent>` **(** :ref:`int<class_int>` bone_idx, :ref:`int<class_int>` parent_idx **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bone_pose_position<class_Skeleton3D_method_set_bone_pose_position>` **(** :ref:`int<class_int>` bone_idx, :ref:`Vector3<class_Vector3>` position **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bone_pose_rotation<class_Skeleton3D_method_set_bone_pose_rotation>` **(** :ref:`int<class_int>` bone_idx, :ref:`Quaternion<class_Quaternion>` rotation **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bone_pose_scale<class_Skeleton3D_method_set_bone_pose_scale>` **(** :ref:`int<class_int>` bone_idx, :ref:`Vector3<class_Vector3>` scale **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bone_rest<class_Skeleton3D_method_set_bone_rest>` **(** :ref:`int<class_int>` bone_idx, :ref:`Transform3D<class_Transform3D>` rest **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`unparent_bone_and_rest<class_Skeleton3D_method_unparent_bone_and_rest>` **(** :ref:`int<class_int>` bone_idx **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_Skeleton3D_signal_bone_enabled_changed:
.. rst-class:: classref-signal
**bone_enabled_changed** **(** :ref:`int<class_int>` bone_idx **)**
.. container:: contribute
There is currently no description for this signal. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_signal_bone_pose_changed:
.. rst-class:: classref-signal
**bone_pose_changed** **(** :ref:`int<class_int>` bone_idx **)**
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.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_signal_pose_updated:
.. rst-class:: classref-signal
**pose_updated** **(** **)**
.. container:: contribute
There is currently no description for this signal. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_signal_show_rest_only_changed:
.. rst-class:: classref-signal
**show_rest_only_changed** **(** **)**
.. container:: contribute
There is currently no description for this signal. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Constants
---------
.. _class_Skeleton3D_constant_NOTIFICATION_UPDATE_SKELETON:
.. rst-class:: classref-constant
**NOTIFICATION_UPDATE_SKELETON** = ``50``
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_Skeleton3D_property_animate_physical_bones:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **animate_physical_bones** = ``true``
.. rst-class:: classref-property-setget
- void **set_animate_physical_bones** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_animate_physical_bones** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_property_motion_scale:
.. rst-class:: classref-property
:ref:`float<class_float>` **motion_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_motion_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_motion_scale** **(** **)**
Multiplies the position 3D track animation.
\ **Note:** Unless this value is ``1.0``, the key value in animation will not match the actual position value.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_property_show_rest_only:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **show_rest_only** = ``false``
.. rst-class:: classref-property-setget
- void **set_show_rest_only** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_show_rest_only** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_Skeleton3D_method_add_bone:
.. rst-class:: classref-method
void **add_bone** **(** :ref:`String<class_String>` name **)**
Adds a bone, with name ``name``. :ref:`get_bone_count<class_Skeleton3D_method_get_bone_count>` will become the bone index.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_clear_bones:
.. rst-class:: classref-method
void **clear_bones** **(** **)**
Clear all the bones in this skeleton.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_clear_bones_global_pose_override:
.. rst-class:: classref-method
void **clear_bones_global_pose_override** **(** **)**
Removes the global pose override on all bones in the skeleton.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_create_skin_from_rest_transforms:
.. rst-class:: classref-method
:ref:`Skin<class_Skin>` **create_skin_from_rest_transforms** **(** **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_find_bone:
.. rst-class:: classref-method
:ref:`int<class_int>` **find_bone** **(** :ref:`String<class_String>` name **)** |const|
Returns the bone index that matches ``name`` as its name.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_force_update_all_bone_transforms:
.. rst-class:: classref-method
void **force_update_all_bone_transforms** **(** **)**
Force updates the bone transforms/poses for all bones in the skeleton.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_force_update_bone_child_transform:
.. rst-class:: classref-method
void **force_update_bone_child_transform** **(** :ref:`int<class_int>` bone_idx **)**
Force updates the bone transform for the bone at ``bone_idx`` and all of its children.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_children:
.. rst-class:: classref-method
:ref:`PackedInt32Array<class_PackedInt32Array>` **get_bone_children** **(** :ref:`int<class_int>` bone_idx **)** |const|
Returns an array containing the bone indexes of all the children node of the passed in bone, ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_bone_count** **(** **)** |const|
Returns the number of bones in the skeleton.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_global_pose:
.. rst-class:: classref-method
:ref:`Transform3D<class_Transform3D>` **get_bone_global_pose** **(** :ref:`int<class_int>` bone_idx **)** |const|
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.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_global_pose_no_override:
.. rst-class:: classref-method
:ref:`Transform3D<class_Transform3D>` **get_bone_global_pose_no_override** **(** :ref:`int<class_int>` bone_idx **)** |const|
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.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_global_pose_override:
.. rst-class:: classref-method
:ref:`Transform3D<class_Transform3D>` **get_bone_global_pose_override** **(** :ref:`int<class_int>` bone_idx **)** |const|
Returns the global pose override transform for ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_global_rest:
.. rst-class:: classref-method
:ref:`Transform3D<class_Transform3D>` **get_bone_global_rest** **(** :ref:`int<class_int>` bone_idx **)** |const|
Returns the global rest transform for ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_bone_name** **(** :ref:`int<class_int>` bone_idx **)** |const|
Returns the name of the bone at index ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_parent:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_bone_parent** **(** :ref:`int<class_int>` bone_idx **)** |const|
Returns the bone index which is the parent of the bone at ``bone_idx``. If -1, then bone has no parent.
\ **Note:** The parent bone returned will always be less than ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_pose:
.. rst-class:: classref-method
:ref:`Transform3D<class_Transform3D>` **get_bone_pose** **(** :ref:`int<class_int>` bone_idx **)** |const|
Returns the pose transform of the specified bone.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_pose_position:
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_bone_pose_position** **(** :ref:`int<class_int>` bone_idx **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_pose_rotation:
.. rst-class:: classref-method
:ref:`Quaternion<class_Quaternion>` **get_bone_pose_rotation** **(** :ref:`int<class_int>` bone_idx **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_pose_scale:
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_bone_pose_scale** **(** :ref:`int<class_int>` bone_idx **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_bone_rest:
.. rst-class:: classref-method
:ref:`Transform3D<class_Transform3D>` **get_bone_rest** **(** :ref:`int<class_int>` bone_idx **)** |const|
Returns the rest transform for a bone ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_parentless_bones:
.. rst-class:: classref-method
:ref:`PackedInt32Array<class_PackedInt32Array>` **get_parentless_bones** **(** **)** |const|
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.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_get_version:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_version** **(** **)** |const|
Returns the number of times the bone hierarchy has changed within this skeleton, including renames.
The Skeleton version is not serialized: only use within a single instance of Skeleton3D.
Use for invalidating caches in IK solvers and other nodes which process bones.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_is_bone_enabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_bone_enabled** **(** :ref:`int<class_int>` bone_idx **)** |const|
Returns whether the bone pose for the bone at ``bone_idx`` is enabled.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_localize_rests:
.. rst-class:: classref-method
void **localize_rests** **(** **)**
Returns all bones in the skeleton to their rest poses.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_physical_bones_add_collision_exception:
.. rst-class:: classref-method
void **physical_bones_add_collision_exception** **(** :ref:`RID<class_RID>` exception **)**
Adds a collision exception to the physical bone.
Works just like the :ref:`RigidBody3D<class_RigidBody3D>` node.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_physical_bones_remove_collision_exception:
.. rst-class:: classref-method
void **physical_bones_remove_collision_exception** **(** :ref:`RID<class_RID>` exception **)**
Removes a collision exception to the physical bone.
Works just like the :ref:`RigidBody3D<class_RigidBody3D>` node.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_physical_bones_start_simulation:
.. rst-class:: classref-method
void **physical_bones_start_simulation** **(** :ref:`StringName[]<class_StringName>` bones=[] **)**
Tells the :ref:`PhysicalBone3D<class_PhysicalBone3D>` nodes in the Skeleton to start simulating and reacting to the physics world.
Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_physical_bones_stop_simulation:
.. rst-class:: classref-method
void **physical_bones_stop_simulation** **(** **)**
Tells the :ref:`PhysicalBone3D<class_PhysicalBone3D>` nodes in the Skeleton to stop simulating.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_register_skin:
.. rst-class:: classref-method
:ref:`SkinReference<class_SkinReference>` **register_skin** **(** :ref:`Skin<class_Skin>` skin **)**
Binds the given Skin to the Skeleton.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_reset_bone_pose:
.. rst-class:: classref-method
void **reset_bone_pose** **(** :ref:`int<class_int>` bone_idx **)**
Sets the bone pose to rest for ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_reset_bone_poses:
.. rst-class:: classref-method
void **reset_bone_poses** **(** **)**
Sets all bone poses to rests.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_set_bone_enabled:
.. rst-class:: classref-method
void **set_bone_enabled** **(** :ref:`int<class_int>` bone_idx, :ref:`bool<class_bool>` enabled=true **)**
Disables the pose for the bone at ``bone_idx`` if ``false``, enables the bone pose if ``true``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_set_bone_global_pose_override:
.. rst-class:: classref-method
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 **)**
Sets the global pose transform, ``pose``, for the bone at ``bone_idx``.
\ ``amount`` is the interpolation strength that will be used when applying the pose, and ``persistent`` determines if the applied pose will remain.
\ **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.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_set_bone_name:
.. rst-class:: classref-method
void **set_bone_name** **(** :ref:`int<class_int>` bone_idx, :ref:`String<class_String>` name **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_set_bone_parent:
.. rst-class:: classref-method
void **set_bone_parent** **(** :ref:`int<class_int>` bone_idx, :ref:`int<class_int>` parent_idx **)**
Sets the bone index ``parent_idx`` as the parent of the bone at ``bone_idx``. If -1, then bone has no parent.
\ **Note:** ``parent_idx`` must be less than ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_set_bone_pose_position:
.. rst-class:: classref-method
void **set_bone_pose_position** **(** :ref:`int<class_int>` bone_idx, :ref:`Vector3<class_Vector3>` position **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_set_bone_pose_rotation:
.. rst-class:: classref-method
void **set_bone_pose_rotation** **(** :ref:`int<class_int>` bone_idx, :ref:`Quaternion<class_Quaternion>` rotation **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_set_bone_pose_scale:
.. rst-class:: classref-method
void **set_bone_pose_scale** **(** :ref:`int<class_int>` bone_idx, :ref:`Vector3<class_Vector3>` scale **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_set_bone_rest:
.. rst-class:: classref-method
void **set_bone_rest** **(** :ref:`int<class_int>` bone_idx, :ref:`Transform3D<class_Transform3D>` rest **)**
Sets the rest transform for bone ``bone_idx``.
.. rst-class:: classref-item-separator
----
.. _class_Skeleton3D_method_unparent_bone_and_rest:
.. rst-class:: classref-method
void **unparent_bone_and_rest** **(** :ref:`int<class_int>` bone_idx **)**
Unparents the bone at ``bone_idx`` and sets its rest position to that of its parent prior to being reset.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`