Table of Contents

Class SkeletonProfile

Namespace
Godot
Assembly
GodotSharp.dll

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.

public class SkeletonProfile : Resource, IDisposable
Inheritance
SkeletonProfile
Implements
Derived
Inherited Members

Constructors

SkeletonProfile()

public SkeletonProfile()

Properties

BoneSize

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.

public int BoneSize { get; set; }

Property Value

int

GroupSize

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.

public int GroupSize { get; set; }

Property Value

int

RootBone

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.

public StringName RootBone { get; set; }

Property Value

StringName

ScaleBaseBone

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

public StringName ScaleBaseBone { get; set; }

Property Value

StringName

Methods

FindBone(StringName)

Returns the bone index that matches boneName as its name.

public int FindBone(StringName boneName)

Parameters

boneName StringName

Returns

int

GetBoneName(int)

Returns the name of the bone at boneIdx 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.

public StringName GetBoneName(int boneIdx)

Parameters

boneIdx int

Returns

StringName

GetBoneParent(int)

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

public StringName GetBoneParent(int boneIdx)

Parameters

boneIdx int

Returns

StringName

GetBoneTail(int)

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

public StringName GetBoneTail(int boneIdx)

Parameters

boneIdx int

Returns

StringName

GetGroup(int)

Returns the group of the bone at boneIdx.

public StringName GetGroup(int boneIdx)

Parameters

boneIdx int

Returns

StringName

GetGroupName(int)

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

public StringName GetGroupName(int groupIdx)

Parameters

groupIdx int

Returns

StringName

GetHandleOffset(int)

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

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

public Vector2 GetHandleOffset(int boneIdx)

Parameters

boneIdx int

Returns

Vector2

GetReferencePose(int)

Returns the reference pose transform for bone boneIdx.

public Transform3D GetReferencePose(int boneIdx)

Parameters

boneIdx int

Returns

Transform3D

GetTailDirection(int)

Returns the tail direction of the bone at boneIdx.

public SkeletonProfile.TailDirection GetTailDirection(int boneIdx)

Parameters

boneIdx int

Returns

SkeletonProfile.TailDirection

GetTexture(int)

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

public Texture2D GetTexture(int groupIdx)

Parameters

groupIdx int

Returns

Texture2D

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

SetBoneName(int, StringName)

Sets the name of the bone at boneIdx 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.

public void SetBoneName(int boneIdx, StringName boneName)

Parameters

boneIdx int
boneName StringName

SetBoneParent(int, StringName)

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

public void SetBoneParent(int boneIdx, StringName boneParent)

Parameters

boneIdx int
boneParent StringName

SetBoneTail(int, StringName)

Sets the bone with name boneTail as the tail of the bone at boneIdx.

public void SetBoneTail(int boneIdx, StringName boneTail)

Parameters

boneIdx int
boneTail StringName

SetGroup(int, StringName)

Sets the group of the bone at boneIdx.

public void SetGroup(int boneIdx, StringName group)

Parameters

boneIdx int
group StringName

SetGroupName(int, StringName)

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

public void SetGroupName(int groupIdx, StringName groupName)

Parameters

groupIdx int
groupName StringName

SetHandleOffset(int, Vector2)

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

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

public void SetHandleOffset(int boneIdx, Vector2 handleOffset)

Parameters

boneIdx int
handleOffset Vector2

SetReferencePose(int, Transform3D)

Sets the reference pose transform for bone boneIdx.

public void SetReferencePose(int boneIdx, Transform3D boneName)

Parameters

boneIdx int
boneName Transform3D

SetTailDirection(int, TailDirection)

Sets the tail direction of the bone at boneIdx.

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.

public void SetTailDirection(int boneIdx, SkeletonProfile.TailDirection tailDirection)

Parameters

boneIdx int
tailDirection SkeletonProfile.TailDirection

SetTexture(int, Texture2D)

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

public void SetTexture(int groupIdx, Texture2D texture)

Parameters

groupIdx int
texture Texture2D

Events

ProfileUpdated

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.

public event Action ProfileUpdated

Event Type

Action