Skeleton

    Skeleton for characters and animated objects.

    Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see ). It can also use ragdoll physics.

    The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose.

    Note that “global pose” below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone.

    Tutorials

    Signals

    • skeleton_updated ( )
    • NOTIFICATION_UPDATE_SKELETON = 50

    Method Descriptions

    • void add_bone ( name )

    Adds a bone, with name . get_bone_count will become the bone index.


    • void bind_child_node_to_bone ( bone_idx, Node node )

    Deprecated soon.


    Clear all the bones in this skeleton.


    • void clear_bones_global_pose_override ( )

    • find_bone ( String name ) const

    Returns the bone index that matches name as its name.


    • get_bone_count ( ) const

    Returns the amount of bones in the skeleton.


    • Transform get_bone_custom_pose ( bone_idx ) const

    Returns the custom pose of the specified bone. Custom pose is applied on top of the rest pose.


    • Transform get_bone_global_pose ( 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.


    • Transform get_bone_global_pose_no_override ( 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.


    • String get_bone_name ( bone_idx ) const

    Returns the name of the bone at index index.


    • int get_bone_parent ( 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 .


    Returns the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose.


    Returns the rest transform for a bone bone_idx.


    • Array get_bound_child_nodes_to_bone ( bone_idx ) const

    Deprecated soon.


    • bool is_bone_rest_disabled ( bone_idx ) const


    • void physical_bones_add_collision_exception ( RID exception )

    • void physical_bones_remove_collision_exception ( exception )

    • void physical_bones_start_simulation ( Array bones=[ ] )

    • void physical_bones_stop_simulation ( )

    • register_skin ( Skin skin )

    • void set_bone_custom_pose ( bone_idx, Transform custom_pose )

    • void set_bone_disable_rest ( bone_idx, bool disable )

    • void set_bone_global_pose_override ( bone_idx, Transform pose, amount, bool persistent=false )

    • void set_bone_name ( bone_idx, String name )

    • void set_bone_parent ( bone_idx, 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: must be less than bone_idx.


    • void set_bone_pose ( bone_idx, Transform pose )

    Sets the pose transform for bone bone_idx.


    • void set_bone_rest ( bone_idx, Transform rest )

    Deprecated soon.


    • void unparent_bone_and_rest ( bone_idx )