AnimationClip
An AnimationClip is a reusable set of keyframe tracks which represent an animation.
For an overview of the different elements of the three.js animation system see the "Animation System" article in the "Next Steps" section of the manual.
Constructor
AnimationClip
function AnimationClip( name: String, duration: Number, tracks: Array ): void;
name - a name for this clip.
duration - the duration of this clip (in seconds). If a negative value is
passed, the duration will be calculated from the passed tracks array.
tracks - an array of KeyframeTracks.
blendMode - defines how the animation is blended/combined when two or
more animations are simultaneously played.
Note: Instead of instantiating an AnimationClip directly with the constructor, you can use one of its static methods to create AnimationClips: from JSON (.parse), from morph target sequences (.CreateFromMorphTargetSequence, .CreateClipsFromMorphTargetSequences) or from animation hierarchies (.parseAnimation) - if your model doesn't already hold AnimationClips in its geometry's animations array.
Properties
blendMode
blendMode: Number;
Defines how the animation is blended/combined when two or more animations are simultaneously played. Valid values are NormalAnimationBlendMode (default) and AdditiveAnimationBlendMode.
duration
duration: Number;
The duration of this clip (in seconds). This can be calculated from the .tracks array via .resetDuration.
name
name: String;
A name for this clip. A certain clip can be searched via .findByName.
tracks
tracks: Array;
An array containing a KeyframeTrack for each property that are animated by this clip.
uuid
uuid: String;
The UUID of this clip instance. It gets automatically assigned and shouldn't be edited.
Methods
clone
function clone( ): AnimationClip;
Returns a copy of this clip.
optimize
function optimize( ): this;
Optimizes each track by removing equivalent sequential keys (which are common in morph target sequences).
resetDuration
function resetDuration( ): this;
Sets the .duration of the clip to the duration of its longest KeyframeTrack.