AnimationClip class

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

Constructors

AnimationClip.new(String name, [num duration = -1, List<KeyframeTrack>? tracks, int blendMode = NormalAnimationBlendMode])
name - a name for this clip.

Properties

blendMode int
getter/setter pair
duration num
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
name String
getter/setter pair
results List
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tracks List<KeyframeTrack>
getter/setter pair
uuid String
getter/setter pair

Methods

clone() AnimationClip
Returns a copy of this clip.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optimize() AnimationClip
Optimizes each track by removing equivalent sequential keys (which are common in morph target sequences).
resetDuration() AnimationClip
Sets the duration of the clip to the duration of its longest KeyframeTrack.
toJson() Map<String, dynamic>
Returns a JSON object representing the serialized animation clip.
toString() String
A string representation of this object.
inherited
trim() AnimationClip
Trims all tracks to the clip's duration.
validate() bool
Performs minimal validation on each track in the clip. Returns true if all tracks are valid.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createClipsFromMorphTargetSequences(List<MorphTarget> morphTargets, int fps, [bool noLoop = false]) List<AnimationClip>
Returns a new AnimationClip from the passed morph targets array of a geometry, taking a name and the number of frames per second.
createFromMorphTargetSequence(String name, List<MorphTarget> morphTargetSequence, int fps, bool noLoop) AnimationClip
Returns 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...".
findByName(List<AnimationClip> objectOrClipArray, String name) AnimationClip?
Searches for an AnimationClip by name, taking as its first parameter either an array of AnimationClips, or a mesh or geometry that contains an array named "animations".
parse(Map<String, dynamic> json) AnimationClip
parseAnimation(Map<String, dynamic>? animation, dynamic bones) AnimationClip?
toJsonStatic(AnimationClip clip) Map<String, dynamic>