Class Skeleton
Implements
Index
Constructors
Properties
Accessors
Methods
Properties
animations
Gets the list of animations attached to this skeleton
bones
Defines the list of child bones
dimensions At Rest
Defines an estimate of the dimension of the skeleton at rest
do Not Serialize
Specifies if the skeleton should be serialized
id
defines the skeleton Id
inspectable Custom Properties
List of inspectable custom properties (used by the Inspector)
metadata
Gets or sets an object used to store user defined information for the skeleton
name
defines the skeleton name
need Initial Skin Matrix
Defines a boolean indicating if the root matrix is provided by meshes or by the current skeleton (this is the default value)
on Before Compute Observable
An observable triggered before computing the skeleton's matrices
Accessors
animation Properties Override
-
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
-
Parameters
- value: Nullable<AnimationPropertiesOverride>
Returns void
is Using Texture For Matrices
-
get isUsingTextureForMatrices(): boolean
Gets a boolean indicating that the skeleton effectively stores matrices into a texture
Returns boolean
unique Id
-
get uniqueId(): number
Gets the unique ID of this skeleton
Returns number
use Texture To Store Bone Matrices
-
get useTextureToStoreBoneMatrices(): boolean
Gets or sets a boolean indicating that bone matrices should be stored as a texture instead of using shader uniforms (default is true). Please note that this option is not available if the hardware does not support it
Returns boolean
-
set useTextureToStoreBoneMatrices(value: boolean): void
Parameters
- value: boolean
Returns void
Methods
begin Animation
-
beginAnimation(
name: string,
loop?: boolean,
speedRatio?: number,
onAnimationEnd?: () => void,
): Nullable<Animatable>Begin a specific animation range
Parameters
- name: string
defines the name of the range to start
Optionalloop: booleandefines if looping must be turned on (false by default)
OptionalspeedRatio: numberdefines the speed ratio to apply (1 by default)
OptionalonAnimationEnd: () => voiddefines a callback which will be called when animation will end
Returns Nullable<Animatable>
a new animatable
- name: string
clone
-
Clone the current skeleton
Parameters
- name: string
defines the name of the new skeleton
Optionalid: stringdefines the id of the new skeleton
Returns Skeleton
the new skeleton
- name: string
compute Absolute Matrices
-
Compute all node absolute matrices
Parameters
- forceUpdate: boolean = false
defines if computation must be done even if cache is up to date
Returns void
- forceUpdate: boolean = false
compute Absolute Transforms
copy Animation Range
-
Copy animation range from a source skeleton. This is not for a complete retargeting, only between very similar skeleton's with only possible bone length differences
Parameters
- source: Skeleton
defines the source skeleton
- name: string
defines the name of the range to copy
- rescaleAsRequired: boolean = false
defines if rescaling must be applied if required
Returns boolean
true if operation was successful
- source: Skeleton
create Animation Range
-
Create a new animation range
Parameters
- name: string
defines the name of the range
- from: number
defines the start key
- to: number
defines the end key
Returns void
- name: string
delete Animation Range
-
Delete a specific animation range
Parameters
- name: string
defines the name of the range
- deleteFrames: boolean = true
defines if frames must be removed as well
Returns void
- name: string
dispose
-
Releases all resources associated with the current skeleton
Returns void
enable Blending
-
Enable animation blending for this skeleton
Parameters
- blendingSpeed: number = 0.01
defines the blending speed to apply
Returns void
- blendingSpeed: number = 0.01
find Bone From Linked Transform Node
-
Finds a bone in a skeleton that is linked to the given transform node.
Parameters
- transformNode: TransformNode
The transform node to find the bone for
Returns Bone | null
The bone linked to the transform node, or null if not found
- transformNode: TransformNode
find Bone From Linked Transform Node Name
-
Finds a bone in a skeleton by the name of its linked transform node.
Parameters
- name: string
The name of the linked transform node
Returns Bone | null
The bone linked to the transform node with the given name, or null if not found
- name: string
get Animatables
-
Gets the list of animatables currently running for this skeleton
Returns IAnimatable[]
an array of animatables
get Animation Range
-
Gets a specific animation range
Parameters
- name: string
defines the name of the range to look for
Returns Nullable<AnimationRange>
the requested animation range or null if not found
- name: string
get Animation Ranges
-
Gets the list of all animation ranges defined on this skeleton
Returns Nullable<AnimationRange>[]
an array
get Bone Index By Name
-
Get bone's index searching by name
Parameters
- name: string
defines bone's name to search for
Returns number
the indice of the bone. Returns -1 if not found
- name: string
get Children
get Class Name
-
Gets the current object class name.
Returns string
the class name
get Pose Matrix
get Scene
get Transform Matrices
-
Gets the list of transform matrices to send to shaders (one matrix per bone)
Parameters
- mesh: Nullable<AbstractMesh>
defines the mesh to use to get the root matrix (if needInitialSkinMatrix === true)
Returns Float32Array
a Float32Array containing matrices data
- mesh: Nullable<AbstractMesh>
get Transform Matrix Texture
-
Gets the list of transform matrices to send to shaders inside a texture (one matrix per bone)
Parameters
- mesh: AbstractMesh
defines the mesh to use to get the root matrix (if needInitialSkinMatrix === true)
Returns Nullable<RawTexture>
a raw texture containing the data
- mesh: AbstractMesh
prepare
-
Build all resources required to render a skeleton
Parameters
- dontCheckFrameId: boolean = false
defines a boolean indicating if prepare should be run without checking first the current frame id (default: false)
Returns void
- dontCheckFrameId: boolean = false
return To Rest
-
Forces the skeleton to go to rest pose
Returns void
serialize
-
Serialize the skeleton in a JSON object
Returns any
a JSON object
set Current Pose As Rest
-
Set the current local matrix as the restPose for all bones in the skeleton.
Returns void
sort Bones
-
Sorts bones per internal index
Returns void
to String
-
Gets a string representing the current skeleton data
Parameters
OptionalfullDetails: booleandefines a boolean indicating if we want a verbose version
Returns string
a string representing the current skeleton data
StaticMake Animation Additive
-
MakeAnimationAdditive(
skeleton: Skeleton,
referenceFrame?: number,
range: string,
): Nullable<Skeleton>Convert the keyframes for a range of animation on a skeleton to be relative to a given reference frame.
Parameters
- skeleton: Skeleton
defines the Skeleton containing the animation range to convert
- referenceFrame: number = 0
defines the frame that keyframes in the range will be relative to
- range: string
defines the name of the AnimationRange belonging to the Skeleton to convert
Returns Nullable<Skeleton>
the original skeleton
- skeleton: Skeleton
Class used to handle skinning animations
See
https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons