Table of Contents

Class SkeletonProfile

Base class for a profile of a virtual skeleton used as a target for retargeting.

Inheritance
SkeletonProfile
Derived

Remarks

This resource is used in EditorScenePostImport. Some parameters are referring to bones in Skeleton3D, Skin, Animation, and some other nodes are rewritten based on the parameters of SkeletonProfile.

Note: These parameters need to be set only when creating a custom profile. In SkeletonProfileHumanoid, they are defined internally as read-only values.

See Also

Properties

bone_size

The amount of bones in retargeting section's BoneMap editor. For example, SkeletonProfileHumanoid has 56 bones.

The size of elements in BoneMap updates when changing this property in it's assigned SkeletonProfile.

var bone_size : int = 0

Property Value

int

Remarks

  • void set_bone_size(int value)
  • int get_bone_size

group_size

The amount of groups of bones in retargeting section's BoneMap editor. For example, SkeletonProfileHumanoid has 4 groups.

This property exists to separate the bone list into several sections in the editor.

var group_size : int = 0

Property Value

int

Remarks

  • void set_group_size(int value)
  • int get_group_size

root_bone

A bone name that will be used as the root bone in AnimationTree. This should be the bone of the parent of hips that exists at the world origin.

var root_bone : StringName = &""

Property Value

StringName

Remarks

scale_base_bone

A bone name which will use model's height as the coefficient for normalization. For example, SkeletonProfileHumanoid defines it as Hips.

var scale_base_bone : StringName = &""

Property Value

StringName

Remarks

Methods

find_bone(StringName)

Qualifiers: const

Returns the bone index that matches bone_name as its name.

int find_bone(StringName bone_name)

Parameters

bone_name StringName

get_bone_name(int)

Qualifiers: const

Returns the name of the bone at bone_idx that will be the key name in the BoneMap.

In the retargeting process, the returned bone name is the bone name of the target skeleton.

StringName get_bone_name(int bone_idx)

Parameters

bone_idx int

get_bone_parent(int)

Qualifiers: const

Returns the name of the bone which is the parent to the bone at bone_idx. The result is empty if the bone has no parent.

StringName get_bone_parent(int bone_idx)

Parameters

bone_idx int

get_bone_tail(int)

Qualifiers: const

Returns the name of the bone which is the tail of the bone at bone_idx.

StringName get_bone_tail(int bone_idx)

Parameters

bone_idx int

get_group(int)

Qualifiers: const

Returns the group of the bone at bone_idx.

StringName get_group(int bone_idx)

Parameters

bone_idx int

get_group_name(int)

Qualifiers: const

Returns the name of the group at group_idx that will be the drawing group in the BoneMap editor.

StringName get_group_name(int group_idx)

Parameters

group_idx int

get_handle_offset(int)

Qualifiers: const

Returns the offset of the bone at bone_idx that will be the button position in the BoneMap editor.

This is the offset with origin at the top left corner of the square.

Vector2 get_handle_offset(int bone_idx)

Parameters

bone_idx int

get_reference_pose(int)

Qualifiers: const

Returns the reference pose transform for bone bone_idx.

Transform3D get_reference_pose(int bone_idx)

Parameters

bone_idx int

get_tail_direction(int)

Qualifiers: const

Returns the tail direction of the bone at bone_idx.

int get_tail_direction(int bone_idx)

Parameters

bone_idx int

get_texture(int)

Qualifiers: const

Returns the texture of the group at group_idx that will be the drawing group background image in the BoneMap editor.

Texture2D get_texture(int group_idx)

Parameters

group_idx int

is_required(int)

Qualifiers: const

Returns whether the bone at bone_idx is required for retargeting.

This value is used by the bone map editor. If this method returns true, and no bone is assigned, the handle color will be red on the bone map editor.

bool is_required(int bone_idx)

Parameters

bone_idx int

set_bone_name(int, StringName)

Sets the name of the bone at bone_idx that will be the key name in the BoneMap.

In the retargeting process, the setting bone name is the bone name of the target skeleton.

void set_bone_name(int bone_idx, StringName bone_name)

Parameters

bone_idx int
bone_name StringName

set_bone_parent(int, StringName)

Sets the bone with name bone_parent as the parent of the bone at bone_idx. If an empty string is passed, then the bone has no parent.

void set_bone_parent(int bone_idx, StringName bone_parent)

Parameters

bone_idx int
bone_parent StringName

set_bone_tail(int, StringName)

Sets the bone with name bone_tail as the tail of the bone at bone_idx.

void set_bone_tail(int bone_idx, StringName bone_tail)

Parameters

bone_idx int
bone_tail StringName

set_group(int, StringName)

Sets the group of the bone at bone_idx.

void set_group(int bone_idx, StringName group)

Parameters

bone_idx int
group StringName

set_group_name(int, StringName)

Sets the name of the group at group_idx that will be the drawing group in the BoneMap editor.

void set_group_name(int group_idx, StringName group_name)

Parameters

group_idx int
group_name StringName

set_handle_offset(int, Vector2)

Sets the offset of the bone at bone_idx that will be the button position in the BoneMap editor.

This is the offset with origin at the top left corner of the square.

void set_handle_offset(int bone_idx, Vector2 handle_offset)

Parameters

bone_idx int
handle_offset Vector2

set_reference_pose(int, Transform3D)

Sets the reference pose transform for bone bone_idx.

void set_reference_pose(int bone_idx, Transform3D bone_name)

Parameters

bone_idx int
bone_name Transform3D

set_required(int, bool)

Sets the required status for bone bone_idx to required.

void set_required(int bone_idx, bool required)

Parameters

bone_idx int
required bool

set_tail_direction(int, int)

Sets the tail direction of the bone at bone_idx.

Note: This only specifies the method of calculation. The actual coordinates required should be stored in an external skeleton, so the calculation itself needs to be done externally.

void set_tail_direction(int bone_idx, int tail_direction)

Parameters

bone_idx int
tail_direction int

set_texture(int, Texture2D)

Sets the texture of the group at group_idx that will be the drawing group background image in the BoneMap editor.

void set_texture(int group_idx, Texture2D texture)

Parameters

group_idx int
texture Texture2D

Events

profile_updated

This signal is emitted when change the value in profile. This is used to update key name in the BoneMap and to redraw the BoneMap editor.

Note: This signal is not connected directly to editor to simplify the reference, instead it is passed on to editor through the BoneMap.

signal profile_updated