Class: AnimationClip

animation.AnimationClip(name, threeAnimation, metadata)

Represents a single animation clip with metadata and Three.js action

Constructor

new AnimationClip(name, threeAnimation, metadata)

Create an animation clip

Parameters:
Name Type Description
name string

The name of the animation clip

threeAnimation THREE.AnimationClip

The Three.js animation clip

metadata Object

Parsed metadata from animation name

Source:

Members

action :THREE.AnimationAction|null

The Three.js animation action

Type:
  • THREE.AnimationAction | null
Source:

animation :THREE.AnimationClip

The Three.js animation clip

Type:
  • THREE.AnimationClip
Source:

metadata :Object

Parsed metadata about the animation

Type:
  • Object
Source:

mixer :THREE.AnimationMixer|null

The animation mixer

Type:
  • THREE.AnimationMixer | null
Source:

name :string

The name of the animation clip

Type:
  • string
Source:

Methods

createAction(mixer) → {THREE.AnimationAction}

Create and configure a Three.js action for this clip

Parameters:
Name Type Description
mixer THREE.AnimationMixer

The animation mixer

Source:
Returns:

The created action

Type
THREE.AnimationAction

isPlaying() → {boolean}

Check if the animation is currently playing

Source:
Returns:

True if playing, false otherwise

Type
boolean

play(fadeInDurationopt) → {Promise.<void>}

Play the animation with optional fade in

Parameters:
Name Type Attributes Default Description
fadeInDuration number <optional>
0.3

Fade in duration in seconds

Source:
Returns:

Promise that resolves when fade in completes

Type
Promise.<void>

stop(fadeOutDurationopt) → {Promise.<void>}

Stop the animation with optional fade out

Parameters:
Name Type Attributes Default Description
fadeOutDuration number <optional>
0.3

Fade out duration in seconds

Source:
Returns:

Promise that resolves when fade out completes

Type
Promise.<void>