Import
SkeletonUtils is an addon, and must be imported explicitly, see Installation#Addons.
import * as SkeletonUtils from 'three/addons/utils/SkeletonUtils.js';
Methods
.clone( source : Object3D ) : Object3D (inner)
Clones the given 3D object and its descendants, ensuring that any SkinnedMesh instances are
correctly associated with their bones. Bones are also cloned, and must be descendants of the
object passed to this method. Other data, like geometries and materials, are reused by reference.
| source |
The 3D object to clone. |
- Returns: The cloned 3D object.
.retarget( target : Object3D | Skeleton, source : Object3D | Skeleton, options : module:SkeletonUtils~RetargetOptions ) (inner)
Retargets the skeleton from the given source to the target.
Both target and source can be a 3D object with a skeleton property (e.g. a skinned mesh)
or a Skeleton directly.
| target |
The target object. |
| source |
The source object. |
| options |
The options. |
.retargetClip( target : Object3D, source : Object3D | Skeleton, clip : AnimationClip, options : module:SkeletonUtils~RetargetOptions ) : AnimationClip (inner)
Retargets the animation clip of the source to the target 3D object.
The source can be a 3D object with a skeleton property (e.g. a skinned mesh)
or a Skeleton directly.
| target |
The target 3D object. Must have a |
| source |
The source object. |
| clip |
The animation clip. |
| options |
The options. |
- Returns: The retargeted animation clip.
Type Definitions
.RetargetOptions
Retarget options of SkeletonUtils.
|
useFirstFramePosition
boolean |
Whether to use the position of the first frame or not. Default is |
|
fps
number |
The FPS of the clip. |
|
names
Object.<string, string> |
A dictionary for mapping target to source bone names. |
|
getBoneName
function |
A function for mapping bone names. Alternative to |
|
trim
Array.<number> |
Whether to trim the clip or not. If set the array should hold two values for the start and end. |
|
preserveBoneMatrix
boolean |
Whether to preserve bone matrices or not. Default is |
|
preserveBonePositions
boolean |
Whether to preserve bone positions or not. Default is |
|
useTargetMatrix
boolean |
Whether to use the target matrix or not. Default is |
|
hip
string |
The name of the source's hip bone. Default is |
|
hipInfluence
Vector3 |
The hip influence. Default is |
|
scale
number |
The scale. Default is |
|
localOffsets
Object.<string, Matrix4> |
Per-bone local offset matrices, keyed by bone name. |
|
hipPosition
Vector3 |
An additional position offset applied to the hip bone. |