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
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
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
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
Methods
FindBone(StringName)
Returns the bone index that matches boneName
as its name.
public int FindBone(StringName boneName)
Parameters
boneName
StringName
Returns
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
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
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
GetGroup(int)
Returns the group of the bone at boneIdx
.
public StringName GetGroup(int boneIdx)
Parameters
boneIdx
int
Returns
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
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
GetReferencePose(int)
Returns the reference pose transform for bone boneIdx
.
public Transform3D GetReferencePose(int boneIdx)
Parameters
boneIdx
int
Returns
GetTailDirection(int)
Returns the tail direction of the bone at boneIdx
.
public SkeletonProfile.TailDirection GetTailDirection(int boneIdx)
Parameters
boneIdx
int
Returns
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
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_nameName of the method to check for.
Returns
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_nameName of the signal to check for.
Returns
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_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
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
intboneName
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
intboneParent
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
intboneTail
StringName
SetGroup(int, StringName)
Sets the group of the bone at boneIdx
.
public void SetGroup(int boneIdx, StringName group)
Parameters
boneIdx
intgroup
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
intgroupName
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
SetReferencePose(int, Transform3D)
Sets the reference pose transform for bone boneIdx
.
public void SetReferencePose(int boneIdx, Transform3D boneName)
Parameters
boneIdx
intboneName
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
inttailDirection
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
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