Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

Skeleton3D

Inherits: Node3D < Node < Object

A node containing a bone hierarchy, used to create a 3D skeletal animation.

Description

Skeleton3D provides an interface for managing a hierarchy of bones, including pose, rest and animation (see 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 SkeletonIK3D, or add a custom IK implementation in Node._process as a child node.

Tutorials

Properties

bool

animate_physical_bones

true

float

motion_scale

1.0

bool

show_rest_only

false

Methods

void

add_bone ( String name )

void

clear_bones ( )

void

clear_bones_global_pose_override ( )

Skin

create_skin_from_rest_transforms ( )

int

find_bone ( String name ) const

void

force_update_all_bone_transforms ( )

void

force_update_bone_child_transform ( int bone_idx )

PackedInt32Array

get_bone_children ( int bone_idx ) const

int

get_bone_count ( ) const

Transform3D

get_bone_global_pose ( int bone_idx ) const

Transform3D

get_bone_global_pose_no_override ( int bone_idx ) const

Transform3D

get_bone_global_pose_override ( int bone_idx ) const

Transform3D

get_bone_global_rest ( int bone_idx ) const

String

get_bone_name ( int bone_idx ) const

int

get_bone_parent ( int bone_idx ) const

Transform3D

get_bone_pose ( int bone_idx ) const

Vector3

get_bone_pose_position ( int bone_idx ) const

Quaternion

get_bone_pose_rotation ( int bone_idx ) const

Vector3

get_bone_pose_scale ( int bone_idx ) const

Transform3D

get_bone_rest ( int bone_idx ) const

PackedInt32Array

get_parentless_bones ( ) const

int

get_version ( ) const

bool

is_bone_enabled ( int bone_idx ) const

void

localize_rests ( )

void

physical_bones_add_collision_exception ( RID exception )

void

physical_bones_remove_collision_exception ( RID exception )

void

physical_bones_start_simulation ( StringName[] bones=[] )

void

physical_bones_stop_simulation ( )

SkinReference

register_skin ( Skin skin )

void

reset_bone_pose ( int bone_idx )

void

reset_bone_poses ( )

void

set_bone_enabled ( int bone_idx, bool enabled=true )

void

set_bone_global_pose_override ( int bone_idx, Transform3D pose, float amount, bool persistent=false )

void

set_bone_name ( int bone_idx, String name )

void

set_bone_parent ( int bone_idx, int parent_idx )

void

set_bone_pose_position ( int bone_idx, Vector3 position )

void

set_bone_pose_rotation ( int bone_idx, Quaternion rotation )

void

set_bone_pose_scale ( int bone_idx, Vector3 scale )

void

set_bone_rest ( int bone_idx, Transform3D rest )

void

unparent_bone_and_rest ( int bone_idx )


Signals

bone_enabled_changed ( int bone_idx )

There is currently no description for this signal. Please help us by contributing one!


bone_pose_changed ( 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.


pose_updated ( )

There is currently no description for this signal. Please help us by contributing one!


show_rest_only_changed ( )

There is currently no description for this signal. Please help us by contributing one!


Constants

NOTIFICATION_UPDATE_SKELETON = 50


Property Descriptions

bool animate_physical_bones = true

  • void set_animate_physical_bones ( bool value )

  • bool get_animate_physical_bones ( )

There is currently no description for this property. Please help us by contributing one!


float motion_scale = 1.0

  • void set_motion_scale ( float value )

  • float get_motion_scale ( )

Multiplies the 3D position track animation.

Note: Unless this value is 1.0, the key value in animation will not match the actual position value.


bool show_rest_only = false

  • void set_show_rest_only ( bool value )

  • bool is_show_rest_only ( )

There is currently no description for this property. Please help us by contributing one!


Method Descriptions

void add_bone ( String name )

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


void clear_bones ( )

Clear all the bones in this skeleton.


void clear_bones_global_pose_override ( )

Removes the global pose override on all bones in the skeleton.


Skin create_skin_from_rest_transforms ( )

There is currently no description for this method. Please help us by contributing one!


int find_bone ( String name ) const

Returns the bone index that matches name as its name