Capítulo 285 de 859

Chapter 285: AnimationClip

Core Idea

A reusable set of keyframe tracks which represent an animation.

Key Concepts

  • blendMode : NormalAnimationBlendMode | AdditiveAnimationBlendMode: Defines how the animation is blended/combined when two or more animations are simultaneously played.
  • duration : number: The clip's duration in seconds.
  • name : string: The clip's name.
  • tracks : Array.<KeyframeTrack>: An array of keyframe tracks.
  • userData : Object: 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 c…
  • uuid : string (readonly): The UUID of the animation clip.

Reference Tables

Constructor

Signature
`new AnimationClip( name : string, duration : number, tracks : Array.<KeyframeTrack>, blendMode : NormalAnimationBlendMode

Properties

PropertyDescription
`.blendMode : NormalAnimationBlendModeAdditiveAnimationBlendMode`
.duration : numberThe clip's duration in seconds.
.name : stringThe clip's name.
.tracks : Array.<KeyframeTrack>An array of keyframe tracks.
.userData : ObjectAn 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.
.uuid : string (readonly)The UUID of the animation clip.

Methods

MethodDescription
.clone() : AnimationClipReturns a new animation clip with copied values from this instance.
.optimize() : AnimationClipOptimizes each track by removing equivalent sequential keys (which are common in morph target sequences).
.resetDuration() : AnimationClipSets the duration of this clip to the duration of its longest keyframe track.
.toJSON() : ObjectSerializes this animation clip into JSON.
.trim() : AnimationClipTrims all tracks to the clip's duration.
.validate() : booleanPerforms minimal validation on each track in the clip. Returns true if all tracks are valid.

Key Takeaways

  1. Most relevant properties: blendMode, duration, name, tracks.
  2. Key methods: clone, optimize, resetDuration, toJSON.

Connects To