SkeletonProfile

Inherits: Resource < RefCounted < Object

Inherited By: SkeletonProfileHumanoid

Profile of a virtual skeleton used as a target for retargeting.

Description

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.

Properties

int

bone_size

0

int

group_size

0

StringName

root_bone

&""

StringName

scale_base_bone

&""

Methods

int

find_bone ( StringName bone_name ) const

StringName

get_bone_name ( int bone_idx ) const

StringName

get_bone_parent ( int bone_idx ) const

StringName

get_bone_tail ( int bone_idx ) const

StringName

get_group ( int bone_idx ) const

StringName

get_group_name ( int group_idx ) const

Vector2

get_handle_offset ( int bone_idx ) const

Transform3D

get_reference_pose ( int bone_idx ) const

TailDirection

get_tail_direction ( int bone_idx ) const

Texture2D

get_texture ( int group_idx ) const

void

set_bone_name ( int bone_idx, StringName bone_name )

void

set_bone_parent ( int bone_idx, StringName bone_parent )

void

set_bone_tail ( int bone_idx, StringName bone_tail )

void

set_group ( int bone_idx, StringName group )

void

set_group_name ( int group_idx, StringName group_name )

void

set_handle_offset ( int bone_idx, Vector2 handle_offset )

void

set_reference_pose ( int bone_idx, Transform3D bone_name )

void

set_tail_direction ( int bone_idx, TailDirection tail_direction )

void

set_texture ( int group_idx, Texture2D texture )

Signals

  • 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.

Enumerations

enum TailDirection:

  • TAIL_DIRECTION_AVERAGE_CHILDREN = 0 --- Direction to the average coordinates of bone children.

  • TAIL_DIRECTION_SPECIFIC_CHILD = 1 --- Direction to the coordinates of specified bone child.

  • TAIL_DIRECTION_END = 2 --- Direction is not calculated.

Property Descriptions

  • int bone_size

Default

0

Setter

set_bone_size(value)

Getter

get_bone_size()


  • int group_size

Default

0

Setter

set_group_size(value)

Getter

get_group_size()


Default

&""

Setter

set_root_bone(value)

Getter

get_root_bone()

A name of bone that will be used as the root bone in AnimationTree.

Note: In most cases, it is the bone of the parent of the hips that exists at the world origin in the humanoid model.


Default

&""

Setter

set_scale_base_bone(value)

Getter

get_scale_base_bone()

A name of bone which height will be used as the coefficient for normalization.

Note: In most cases, it is hips in the humanoid model.

Method Descriptions

Returns the bone index that matches bone_name as its name.


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.


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.


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


Returns the group of the bone at bone_idx.


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


  • Vector2 get_handle_offset ( int bone_idx ) 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.


Returns the reference pose transform for bone bone_idx.


Returns the tail direction of the bone at bone_idx.


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


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.


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.


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


Sets the group of the bone at bone_idx.


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


  • void set_handle_offset ( int bone_idx, Vector2 handle_offset )

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.


Sets the reference pose transform for bone bone_idx.


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.


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