SkeletonProfile
Base class for a profile of a virtual skeleton used as a target for retargeting.
Base class for a profile of a virtual skeleton used as a target for retargeting.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
SkeletonProfileConstructor
public SkeletonProfile();Properties4
BoneSizeProperty
public int BoneSize { get; set; }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 its assigned SkeletonProfile.
GroupSizeProperty
public int GroupSize { get; set; }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.
RootBoneProperty
public StringName RootBone { get; set; }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.
ScaleBaseBoneProperty
public StringName ScaleBaseBone { get; set; }A bone name which will use model's height as the coefficient for normalization. For example, SkeletonProfileHumanoid defines it as Hips.
Methods29
FindBoneint
public int FindBone(StringName boneName);Returns the bone index that matches bone_name as its name.
| Name | Type | Default |
|---|---|---|
boneName | StringName | — |
intGetBoneNameStringName
public StringName GetBoneName(int boneIdx);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.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
StringNameGetBoneParentStringName
public StringName GetBoneParent(int boneIdx);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.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
StringNameGetBoneSizeint
public int GetBoneSize();intGetBoneTailStringName
public StringName GetBoneTail(int boneIdx);Returns the name of the bone which is the tail of the bone at bone_idx.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
StringNameGetGroupStringName
public StringName GetGroup(int boneIdx);Returns the group of the bone at bone_idx.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
StringNameGetGroupNameStringName
public StringName GetGroupName(int groupIdx);Returns the name of the group at group_idx that will be the drawing group in the BoneMap editor.
| Name | Type | Default |
|---|---|---|
groupIdx | int | — |
StringNameGetGroupSizeint
public int GetGroupSize();intGetHandleOffsetVector2
public Vector2 GetHandleOffset(int boneIdx);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.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
Vector2GetReferencePoseTransform3D
public Transform3D GetReferencePose(int boneIdx);Returns the reference pose transform for bone bone_idx.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
Transform3DGetRootBoneStringName
public StringName GetRootBone();StringNameGetScaleBaseBoneStringName
public StringName GetScaleBaseBone();StringNameGetTailDirectionSkeletonProfile.TailDirection
public SkeletonProfile.TailDirection GetTailDirection(int boneIdx);Returns the tail direction of the bone at bone_idx.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
SkeletonProfile.TailDirectionGetTextureTexture2D
public Texture2D GetTexture(int groupIdx);Returns the texture of the group at group_idx that will be the drawing group background image in the BoneMap editor.
| Name | Type | Default |
|---|---|---|
groupIdx | int | — |
Texture2DIsRequiredbool
public bool IsRequired(int boneIdx);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.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
boolSetBoneNamevoid
public void SetBoneName(int boneIdx, StringName boneName);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.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
boneName | StringName | — |
SetBoneParentvoid
public void SetBoneParent(int boneIdx, StringName boneParent);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.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
boneParent | StringName | — |
SetBoneSizevoid
public void SetBoneSize(int size);| Name | Type | Default |
|---|---|---|
size | int | — |
SetBoneTailvoid
public void SetBoneTail(int boneIdx, StringName boneTail);Sets the bone with name bone_tail as the tail of the bone at bone_idx.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
boneTail | StringName | — |
SetGroupvoid
public void SetGroup(int boneIdx, StringName group);Sets the group of the bone at bone_idx.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
group | StringName | — |
SetGroupNamevoid
public void SetGroupName(int groupIdx, StringName groupName);Sets the name of the group at group_idx that will be the drawing group in the BoneMap editor.
| Name | Type | Default |
|---|---|---|
groupIdx | int | — |
groupName | StringName | — |
SetGroupSizevoid
public void SetGroupSize(int size);| Name | Type | Default |
|---|---|---|
size | int | — |
SetHandleOffsetvoid
public void SetHandleOffset(int boneIdx, Vector2 handleOffset);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.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
handleOffset | Vector2 | — |
SetReferencePosevoid
public void SetReferencePose(int boneIdx, Transform3D boneName);Sets the reference pose transform for bone bone_idx.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
boneName | Transform3D | — |
SetRequiredvoid
public void SetRequired(int boneIdx, bool required);Sets the required status for bone bone_idx to required.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
required | bool | — |
SetRootBonevoid
public void SetRootBone(StringName boneName);| Name | Type | Default |
|---|---|---|
boneName | StringName | — |
SetScaleBaseBonevoid
public void SetScaleBaseBone(StringName boneName);| Name | Type | Default |
|---|---|---|
boneName | StringName | — |
SetTailDirectionvoid
public void SetTailDirection(int boneIdx, SkeletonProfile.TailDirection tailDirection);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.
| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
tailDirection | SkeletonProfile.TailDirection | — |
SetTexturevoid
public void SetTexture(int groupIdx, Texture2D texture);Sets the texture of the group at group_idx that will be the drawing group background image in the BoneMap editor.
| Name | Type | Default |
|---|---|---|
groupIdx | int | — |
texture | Texture2D | — |
Signals and events1
ProfileUpdatedEvent
public event Action 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.
SkeletonProfile.TailDirection
| Value | Description |
|---|---|
AverageChildren = 0 | Direction to the average coordinates of bone children. |
End = 2 | Direction is not calculated. |
SpecificChild = 1 | Direction to the coordinates of specified bone child. |