Constructs a new animation clip.
Note: Instead of instantiating an AnimationClip directly with the constructor, you can use the static interface of this class for creating clips. In most cases though, animation clips will automatically be created by loaders when importing animated 3D assets.
Optionalname: stringThe clip's name.
Optionalduration: numberThe clip's duration in seconds. If a negative value is passed, the duration will be calculated from the passed keyframes.
Optionaltracks: KeyframeTrack[]An array of keyframe tracks.
OptionalblendMode: AnimationBlendModeDefines how the animation is blended/combined when two or more animations are simultaneously played.
Defines how the animation is blended/combined when two or more animations are simultaneously played.
The clip's duration in seconds.
The clip's name.
An array of keyframe tracks.
An object that can be used to store custom data about the animation clip. It should not hold references to functions as these will not be cloned.
ReadonlyuuidThe UUID of the animation clip.
Returns a new animation clip with copied values from this instance.
A clone of this instance.
Optimizes each track by removing equivalent sequential keys (which are common in morph target sequences).
A reference to this animation clip.
Sets the duration of this clip to the duration of its longest keyframe track.
A reference to this animation clip.
Performs minimal validation on each track in the clip. Returns true if all
tracks are valid.
Whether the clip's keyframes are valid or not.
StaticCreateReturns an array of new AnimationClips created from the morph target sequences of a geometry, trying to sort morph target names into animation-group-based patterns like "Walk_001, Walk_002, Run_001, Run_002...".
See MD2Loader#parse as an example for how the method should be used.
A sequence of morph targets.
The Frames-Per-Second value.
Whether the clip should be no loop or not.
An array of new animation clips.
StaticCreateReturns a new animation clip from the passed morph targets array of a geometry, taking a name and the number of frames per second.
Note: The fps parameter is required, but the animation speed can be overridden via AnimationAction#setDuration.
The name of the animation clip.
A sequence of morph targets.
The Frames-Per-Second value.
Whether the clip should be no loop or not.
The new animation clip.
StaticfindSearches for an animation clip by name, taking as its first parameter either an array of clips, or a mesh or geometry that contains an array named "animations" property.
The array or object to search through.
The name to search for.
The found animation clip. Returns null if no clip has been found.
StaticparseFactory method for creating an animation clip from the given JSON.
The serialized animation clip.
The new animation clip.
StaticparseParses the animation.hierarchy format and returns a new animation clip.
A serialized animation clip as JSON.
An array of bones.
The new animation clip.
StatictoSerializes the given animation clip into JSON.
The animation clip to serialize.
The JSON object.
A reusable set of keyframe tracks which represent an animation.