reckfellENGINE

Skeleton3D

A bone hierarchy with reference transforms and current 3D poses.

On this page
class Skeleton3DReckfellSharpInherits Entity3D

Skeleton3D is an Entity for skeletal animation. Bones are stored inside it, rather than as separate child Entities. Rest defines a reference local transform; Pose is the current local transform. Root-bone local space is skeleton space; child-bone local space is its parent-bone space.

GetBoneGlobalPose composes ancestor poses but remains in skeleton space. This example computes the world transform of an existing bone on a skeleton in the tree. It reads current state; for a particular modifier result, coordinate the call with that modifier update phase.

C#
using Reckfell;

public static class BoneWorldExample
{
    public static bool TryGetWorldTransform(Skeleton3D skeleton, string boneName,
        out Transform3D worldTransform)
    {
        worldTransform = Transform3D.Identity;
        if (!skeleton.IsInsideTree())
            return false;
        int index = skeleton.FindBone(boneName);
        if (index < 0)
            return false;
        worldTransform = skeleton.GlobalTransform * skeleton.GetBoneGlobalPose(index);
        return true;
    }
}

See retargeting for names and poses when transferring animation.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

Skeleton3DConstructor
# Skeleton3D
C#
public Skeleton3D();

Properties4

AnimatePhysicalBonesProperty · Deprecated
# AnimatePhysicalBones
C#
public bool AnimatePhysicalBones { get; set; }

If you follow the recommended workflow and explicitly have PhysicalBoneSimulator3D as a child of Skeleton3D, you can control whether it is affected by raycasting without running Skeleton3D.PhysicalBonesStartSimulation, by its SkeletonModifier3D.Active. However, for old (deprecated) configurations, Skeleton3D has an internal virtual PhysicalBoneSimulator3D for compatibility. This property controls the internal virtual PhysicalBoneSimulator3D's SkeletonModifier3D.Active.

ModifierCallbackModeProcessProperty
# ModifierCallbackModeProcess
C#
public Skeleton3D.ModifierCallbackModeProcessEnum ModifierCallbackModeProcess { get; set; }

Sets the processing timing for the Modifier.

MotionScaleProperty
# MotionScale
C#
public float MotionScale { get; set; }

Positive multiplier for bone position animation tracks in AnimationMixer. Does not change the Entity transform or directly assigned SetBonePosePosition values. The native setter rejects values <= 0 and restores 1; do not use 0 to stop animation.

ShowRestOnlyProperty
# ShowRestOnly
C#
public bool ShowRestOnly { get; set; }

If true, forces the bones in their default rest pose, regardless of their values. In the editor, this also prevents the bones from being edited.

Methods60

AddBoneint
# AddBone
C#
public int AddBone(string name);

Adds a new bone with the given name. Returns the new bone's index, or -1 if this method fails. Note: Bone names should be unique, non empty, and cannot include the : and / characters.

Parameters
NameTypeDefault
namestring—
Returns int
Advancevoid
# Advance
C#
public void Advance(double delta);

Manually advance the child SkeletonModifier3Ds by the specified time (in seconds). Note: The delta is temporarily accumulated in the Skeleton3D, and the deferred process uses the accumulated value to process the modification.

Parameters
NameTypeDefault
deltadouble—
ClearBonesvoid
# ClearBones
C#
public void ClearBones();

Clear all the bones in this skeleton.

ClearBonesGlobalPoseOverridevoid · Deprecated
# ClearBonesGlobalPoseOverride
C#
public void ClearBonesGlobalPoseOverride();

Removes the global pose override on all bones in the skeleton.

CreateSkinFromRestTransformsSkin
# CreateSkinFromRestTransforms
C#
public Skin CreateSkinFromRestTransforms();
Returns Skin
FindBoneint
# FindBone
C#
public int FindBone(string name);

Returns the bone index that matches name as its name. Returns -1 if no bone with this name exists.

Parameters
NameTypeDefault
namestring—
Returns int
ForceUpdateAllBoneTransformsvoid · Deprecated
# ForceUpdateAllBoneTransforms
C#
public void ForceUpdateAllBoneTransforms();

Force updates the bone transforms/poses for all bones in the skeleton.

ForceUpdateBoneChildTransformvoid
# ForceUpdateBoneChildTransform
C#
public void ForceUpdateBoneChildTransform(int boneIdx);

Force updates the bone transform for the bone at bone_idx and all of its children.

Parameters
NameTypeDefault
boneIdxint—
GetAnimatePhysicalBonesbool
# GetAnimatePhysicalBones
C#
public bool GetAnimatePhysicalBones();
Returns bool
GetBoneChildrenint[]
# GetBoneChildren
C#
public int[] GetBoneChildren(int boneIdx);

Returns an array containing the bone indexes of all the child node of the passed in bone, bone_idx.

Parameters
NameTypeDefault
boneIdxint—
Returns int[]
GetBoneCountint
# GetBoneCount
C#
public int GetBoneCount();

Returns the number of bones in the skeleton.

Returns int
GetBoneGlobalPoseTransform3D
# GetBoneGlobalPose
C#
public Transform3D GetBoneGlobalPose(int boneIdx);

Computes the current bone pose including its parents, in Skeleton3D coordinates. Global here does not mean world transform. For world space, multiply Skeleton3D.GlobalTransform by the result. The value depends on the current animation/modifier update phase.

Parameters
NameTypeDefault
boneIdxint—
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

Returns Transform3D

Transform in Skeleton3D coordinates, without the Entity world transform.

GetBoneGlobalPoseNoOverrideTransform3D · Deprecated
# GetBoneGlobalPoseNoOverride
C#
public Transform3D GetBoneGlobalPoseNoOverride(int boneIdx);

Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone.

Parameters
NameTypeDefault
boneIdxint—
Returns Transform3D
GetBoneGlobalPoseOverrideTransform3D · Deprecated
# GetBoneGlobalPoseOverride
C#
public Transform3D GetBoneGlobalPoseOverride(int boneIdx);

Returns the global pose override transform for bone_idx.

Parameters
NameTypeDefault
boneIdxint—
Returns Transform3D
GetBoneGlobalRestTransform3D
# GetBoneGlobalRest
C#
public Transform3D GetBoneGlobalRest(int boneIdx);

Reads the composition of the bone Rest and its ancestors in Skeleton3D coordinates. Does not use current animated poses or include the skeleton world transform.

Parameters
NameTypeDefault
boneIdxint—
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

Returns Transform3D

Transform in Skeleton3D coordinates, without the Entity world transform.

GetBoneMetaVariant
# GetBoneMeta
C#
public Variant GetBoneMeta(int boneIdx, StringName key);

Returns the metadata with the given key for the bone at index bone_idx.

Parameters
NameTypeDefault
boneIdxint—
keyStringName—
Returns Variant
GetBoneMetaListReckfell.Collections.Array<StringName>
# GetBoneMetaList
C#
public Reckfell.Collections.Array<StringName> GetBoneMetaList(int boneIdx);

Returns the list of all metadata keys for the bone at index bone_idx.

Parameters
NameTypeDefault
boneIdxint—
Returns Reckfell.Collections.Array<StringName>
GetBoneNamestring
# GetBoneName
C#
public string GetBoneName(int boneIdx);

Returns the name of the bone at index bone_idx.

Parameters
NameTypeDefault
boneIdxint—
Returns string
GetBoneParentint
# GetBoneParent
C#
public int GetBoneParent(int boneIdx);

Returns the bone index which is the parent of the bone at bone_idx. If -1, then bone has no parent. Note: The parent bone returned will always be less than bone_idx.

Parameters
NameTypeDefault
boneIdxint—
Returns int
GetBonePoseTransform3D
# GetBonePose
C#
public Transform3D GetBonePose(int boneIdx);

Reads the current local bone transform relative to its parent bone, or the skeleton for a root. Not an additional transform automatically multiplied by Rest. Animation and modifiers can change the pose during their update phase.

Parameters
NameTypeDefault
boneIdxint—
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

Returns Transform3D

Local transform relative to the parent bone, or skeleton for a root.

GetBonePosePositionVector3
# GetBonePosePosition
C#
public Vector3 GetBonePosePosition(int boneIdx);

Reads the position component of local Bone Pose relative to the parent bone; for a root bone, relative to the skeleton. Not a world position or a child bone accumulated position in the skeleton.

Parameters
NameTypeDefault
boneIdxint—
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

Returns Vector3

Local position in parent-bone coordinates, or skeleton coordinates for a root.

GetBonePoseRotationQuaternion
# GetBonePoseRotation
C#
public Quaternion GetBonePoseRotation(int boneIdx);

Returns the pose rotation of the bone at bone_idx. The returned Quaternion is local to the bone with respect to the rotation of any parent bones.

Parameters
NameTypeDefault
boneIdxint—
Returns Quaternion
GetBonePoseScaleVector3
# GetBonePoseScale
C#
public Vector3 GetBonePoseScale(int boneIdx);

Returns the pose scale of the bone at bone_idx.

Parameters
NameTypeDefault
boneIdxint—
Returns Vector3
GetBoneRestTransform3D
# GetBoneRest
C#
public Transform3D GetBoneRest(int boneIdx);

Reads the reference transform relative to the parent bone, or skeleton for a root. Separate data from the mutable current pose.

Parameters
NameTypeDefault
boneIdxint—
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

Returns Transform3D

Local transform relative to the parent bone, or skeleton for a root.

GetBoneSkinScaleVector3
# GetBoneSkinScale
C#
public Vector3 GetBoneSkinScale(int boneIdx);

Returns the skin scale of the bone at bone_idx.

Parameters
NameTypeDefault
boneIdxint—
Returns Vector3
GetConcatenatedBoneNamesStringName
# GetConcatenatedBoneNames
C#
public StringName GetConcatenatedBoneNames();

Returns all bone names concatenated with commas (,) as a single StringName. It is useful to set it as a hint for the enum property.

Returns StringName
GetModifierCallbackModeProcessSkeleton3D.ModifierCallbackModeProcessEnum
# GetModifierCallbackModeProcess
C#
public Skeleton3D.ModifierCallbackModeProcessEnum GetModifierCallbackModeProcess();
Returns Skeleton3D.ModifierCallbackModeProcessEnum
GetMotionScalefloat
# GetMotionScale
C#
public float GetMotionScale();
Returns float
GetParentlessBonesint[]
# GetParentlessBones
C#
public int[] GetParentlessBones();

Returns an array with all of the bones that are parentless. Another way to look at this is that it returns the indexes of all the bones that are not dependent or modified by other bones in the Skeleton.

Returns int[]
GetVersionulong
# GetVersion
C#
public ulong GetVersion();

Returns the number of times the bone hierarchy has changed within this skeleton, including renames. The Skeleton version is not serialized: only use within a single instance of Skeleton3D. Use for invalidating caches in IK solvers and other nodes which process bones.

Returns ulong
HasBoneMetabool
# HasBoneMeta
C#
public bool HasBoneMeta(int boneIdx, StringName key);

Returns true if the bone at index bone_idx has metadata with the given key.

Parameters
NameTypeDefault
boneIdxint—
keyStringName—
Returns bool
IsBoneEnabledbool
# IsBoneEnabled
C#
public bool IsBoneEnabled(int boneIdx);

Returns whether the bone pose for the bone at bone_idx is enabled.

Parameters
NameTypeDefault
boneIdxint—
Returns bool
IsShowRestOnlybool
# IsShowRestOnly
C#
public bool IsShowRestOnly();
Returns bool
LocalizeRestsvoid
# LocalizeRests
C#
public void LocalizeRests();

Returns all bones in the skeleton to their rest poses.

PhysicalBonesAddCollisionExceptionvoid · Deprecated
# PhysicalBonesAddCollisionException
C#
public void PhysicalBonesAddCollisionException(Rid exception);

Adds a collision exception to the physical bone. Works just like the RigidBody3D node.

Parameters
NameTypeDefault
exceptionRid—
PhysicalBonesRemoveCollisionExceptionvoid · Deprecated
# PhysicalBonesRemoveCollisionException
C#
public void PhysicalBonesRemoveCollisionException(Rid exception);

Removes a collision exception to the physical bone. Works just like the RigidBody3D node.

Parameters
NameTypeDefault
exceptionRid—
PhysicalBonesStartSimulationvoid · Deprecated
# PhysicalBonesStartSimulation
C#
public void PhysicalBonesStartSimulation(Reckfell.Collections.Array<StringName> bones = null);

Tells the PhysicalBone3D nodes in the Skeleton to start simulating and reacting to the physics world. Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated.

Parameters
NameTypeDefault
bonesReckfell.Collections.Array<StringName>null
PhysicalBonesStopSimulationvoid · Deprecated
# PhysicalBonesStopSimulation
C#
public void PhysicalBonesStopSimulation();

Tells the PhysicalBone3D nodes in the Skeleton to stop simulating.

RegisterSkinSkinReference
# RegisterSkin
C#
public SkinReference RegisterSkin(Skin skin);

Binds the given Skin to the Skeleton.

Parameters
NameTypeDefault
skinSkin—
Returns SkinReference
ResetBonePose2 overloads
# ResetBonePose · 1/2
C#
public void ResetBonePose(int boneIdx);

Copies Rest position, rotation and scale into one bone current local pose. Does not reset the animation player; later animation or modifiers can change the pose again. The overload without bool retains the separate Bone Skin Scale.

Parameters
NameTypeDefault
boneIdxint—
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

# ResetBonePose · 2/2
C#
public void ResetBonePose(int boneIdx, bool resetBoneSkinScale = false);

Copies Rest position, rotation and scale into one bone current local pose. Does not reset the animation player; later animation or modifiers can change the pose again. The overload without bool retains the separate Bone Skin Scale.

Parameters
NameTypeDefault
boneIdxint—
resetBoneSkinScaleboolfalse
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

resetBoneSkinScale

When true, also reset separate Bone Skin Scale to (1, 1, 1); false retains it. Not a flag controlling ordinary Pose scale, which is copied from Rest in both cases.

ResetBonePoses2 overloads
# ResetBonePoses · 1/2
C#
public void ResetBonePoses();

Resets every bone pose from its Rest. Does not change Rest data or stop animation. The overload without bool retains separate Bone Skin Scale values.

# ResetBonePoses · 2/2
C#
public void ResetBonePoses(bool resetBoneSkinScale = false);

Resets every bone pose from its Rest. Does not change Rest data or stop animation. The overload without bool retains separate Bone Skin Scale values.

Parameters
NameTypeDefault
resetBoneSkinScaleboolfalse
resetBoneSkinScale

When true, also reset separate Bone Skin Scale to (1, 1, 1); false retains it. Not a flag controlling ordinary Pose scale, which is copied from Rest in both cases.

SetAnimatePhysicalBonesvoid
# SetAnimatePhysicalBones
C#
public void SetAnimatePhysicalBones(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetBoneEnabledvoid
# SetBoneEnabled
C#
public void SetBoneEnabled(int boneIdx, bool enabled = true);

Disables the pose for the bone at bone_idx if false, enables the bone pose if true.

Parameters
NameTypeDefault
boneIdxint—
enabledbooltrue
SetBoneGlobalPosevoid
# SetBoneGlobalPose
C#
public void SetBoneGlobalPose(int boneIdx, Transform3D pose);

Sets the global pose transform, pose, for the bone at bone_idx. Note: If other bone poses have been changed, this method executes a dirty poses recalculation and will cause performance to deteriorate. If you know that multiple global poses will be applied, consider using Skeleton3D.SetBonePose with precalculation.

Parameters
NameTypeDefault
boneIdxint—
poseTransform3D—
SetBoneGlobalPoseOverridevoid · Deprecated
# SetBoneGlobalPoseOverride
C#
public void SetBoneGlobalPoseOverride(int boneIdx, Transform3D pose, float amount, bool persistent = false);

Sets the global pose transform, pose, for the bone at bone_idx. amount is the interpolation strength that will be used when applying the pose, and persistent determines if the applied pose will remain. Note: The pose transform needs to be a global pose! To convert a world transform from a Entity3D to a global bone pose, multiply the Transform3D.AffineInverse of the node's Entity3D.GlobalTransform by the desired world transform.

Parameters
NameTypeDefault
boneIdxint—
poseTransform3D—
amountfloat—
persistentboolfalse
SetBoneMetavoid
# SetBoneMeta
C#
public void SetBoneMeta(int boneIdx, StringName key, Variant value);

Sets the metadata with the given key to value for the bone at index bone_idx.

Parameters
NameTypeDefault
boneIdxint—
keyStringName—
valueVariant—
SetBoneNamevoid
# SetBoneName
C#
public void SetBoneName(int boneIdx, string name);

Sets the bone name, name, for the bone at bone_idx.

Parameters
NameTypeDefault
boneIdxint—
namestring—
SetBoneParentvoid
# SetBoneParent
C#
public void SetBoneParent(int boneIdx, int parentIdx);

Sets the bone index parent_idx as the parent of the bone at bone_idx. If -1, then bone has no parent. Note: parent_idx must be less than bone_idx.

Parameters
NameTypeDefault
boneIdxint—
parentIdxint—
SetBonePosevoid
# SetBonePose
C#
public void SetBonePose(int boneIdx, Transform3D pose);

Sets the pose transform, pose, for the bone at bone_idx.

Parameters
NameTypeDefault
boneIdxint—
poseTransform3D—
SetBonePosePositionvoid
# SetBonePosePosition
C#
public void SetBonePosePosition(int boneIdx, Vector3 position);

Replaces the local pose position relative to the parent bone, or skeleton for a root. Does not add position to Rest. Does not change Rest, rotation or scale; subsequent animation/modifier updates can overwrite the pose.

Parameters
NameTypeDefault
boneIdxint—
positionVector3—
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

position

New position relative to the parent bone; relative to Skeleton3D for a root. Not a world position or an offset added to Rest.

SetBonePoseRotationvoid
# SetBonePoseRotation
C#
public void SetBonePoseRotation(int boneIdx, Quaternion rotation);

Sets the pose rotation of the bone at bone_idx to rotation. rotation is a Quaternion describing a rotation in the bone's local coordinate space with respect to the rotation of any parent bones.

Parameters
NameTypeDefault
boneIdxint—
rotationQuaternion—
SetBonePoseScalevoid
# SetBonePoseScale
C#
public void SetBonePoseScale(int boneIdx, Vector3 scale);

Sets the pose scale of the bone at bone_idx to scale.

Parameters
NameTypeDefault
boneIdxint—
scaleVector3—
SetBoneRestvoid
# SetBoneRest
C#
public void SetBoneRest(int boneIdx, Transform3D rest);

Sets the local reference transform. Does not itself replace the current pose: use ResetBonePose or ResetBonePoses to return to the new Rest. Changing Rest affects skeleton reference geometry; verify skinning and animation separately.

Parameters
NameTypeDefault
boneIdxint—
restTransform3D—
boneIdx

Existing bone index: 0 <= boneIdx < GetBoneCount(). Check FindBone for -1 first.

rest

Local reference bone transform relative to its parent. Convert consistently through ancestors for skeleton-wide coordinates.

SetBoneSkinScalevoid
# SetBoneSkinScale
C#
public void SetBoneSkinScale(int boneIdx, Vector3 skinScale);

Sets the skin scale of the bone at bone_idx to skin_scale. This scale does not affect bone children. This is useful for modifying the visual thickness of a skin. Even if the skin is visually deformed, neither scaling nor repositioning of the bones occurs. This means that you may need to adjust the origin of the child bone to synchronize its joint position with the scaling by using BoneSpaceAdjuster3D. Note: The skin scaling may corrupt the appearance of the gizmo for some SkeletonModifier classes, such as SpringBoneSimulator and IKModifier3D, which rely on bone lengths for skinning.

Parameters
NameTypeDefault
boneIdxint—
skinScaleVector3—
SetModifierCallbackModeProcessvoid
# SetModifierCallbackModeProcess
C#
public void SetModifierCallbackModeProcess(Skeleton3D.ModifierCallbackModeProcessEnum mode);
Parameters
NameTypeDefault
modeSkeleton3D.ModifierCallbackModeProcessEnum—
SetMotionScalevoid
# SetMotionScale
C#
public void SetMotionScale(float motionScale);
Parameters
NameTypeDefault
motionScalefloat—
SetShowRestOnlyvoid
# SetShowRestOnly
C#
public void SetShowRestOnly(bool enabled);
Parameters
NameTypeDefault
enabledbool—
UnparentBoneAndRestvoid
# UnparentBoneAndRest
C#
public void UnparentBoneAndRest(int boneIdx);

Unparents the bone at bone_idx and sets its rest position to that of its parent prior to being reset.

Parameters
NameTypeDefault
boneIdxint—

Signals and events6

BoneEnabledChangedEvent
# BoneEnabledChanged
C#
public event Skeleton3D.BoneEnabledChangedEventHandler BoneEnabledChanged;

Emitted when the bone at bone_idx is toggled with Skeleton3D.SetBoneEnabled. Use Skeleton3D.IsBoneEnabled to check the new value.

Handler parameters
NameTypeDefault
boneIdxlong—
BoneListChangedEvent
# BoneListChanged
C#
public event Action BoneListChanged;

Emitted when the list of bones changes, such as when calling Skeleton3D.AddBone, Skeleton3D.SetBoneParent, Skeleton3D.UnparentBoneAndRest, or Skeleton3D.ClearBones.

PoseUpdatedEvent
# PoseUpdated
C#
public event Action PoseUpdated;

Emitted when the pose is updated. Note: During the update process, this signal is not fired, so modification by SkeletonModifier3D is not detected.

RestUpdatedEvent
# RestUpdated
C#
public event Action RestUpdated;

Emitted when the rest is updated.

ShowRestOnlyChangedEvent
# ShowRestOnlyChanged
C#
public event Action ShowRestOnlyChanged;

Emitted when the value of Skeleton3D.ShowRestOnly changes.

SkeletonUpdatedEvent
# SkeletonUpdated
C#
public event Action SkeletonUpdated;

Emitted when the final pose has been calculated will be applied to the skin in the update process. This means that all SkeletonModifier3D processing is complete. In order to detect the completion of the processing of each SkeletonModifier3D, use SkeletonModifier3D.ModificationProcessed.

Fields and constants1

NotificationUpdateSkeletonField
# NotificationUpdateSkeleton
C#
public const long NotificationUpdateSkeleton = 50;

Notification received when this skeleton's pose needs to be updated. In that case, this is called only once per frame in a deferred process.

Skeleton3D.ModifierCallbackModeProcessEnum

ValueDescription
Idle = 1

Set a flag to process modification during process frames (see Entity.NotificationInternalProcess).

Manual = 2

Do not process modification. Use Skeleton3D.Advance to process the modification manually.

Physics = 0

Set a flag to process modification during physics frames (see Entity.NotificationInternalPhysicsProcess).

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.