Class: AnimationClipFactory

animation.AnimationClipFactory(animationLoader)

Factory for creating animation clips with parsed metadata

Constructor

new AnimationClipFactory(animationLoader)

Create an animation clip factory

Parameters:
Name Type Description
animationLoader AnimationLoader

The animation loader instance

Source:

Members

animationLoader :AnimationLoader

The animation loader for loading animation data

Type:
  • AnimationLoader
Source:

clipCache :Map.<string, AnimationClip>

Cache for created animation clips

Type:
  • Map.<string, AnimationClip>
Source:

Methods

clearCache() → {void}

Clear the clip cache

Source:
Returns:
Type
void

(async) createClip(name) → {Promise.<AnimationClip>}

Create an animation clip from a name

Parameters:
Name Type Description
name string

The animation name

Source:
Returns:

The created animation clip

Type
Promise.<AnimationClip>

(async) createClipsFromModel(model) → {Promise.<Map.<string, AnimationClip>>}

Create all animation clips from a model's animations

Parameters:
Name Type Description
model THREE.Object3D

The 3D model containing animations

Source:
Returns:

Map of animation name to clip

Type
Promise.<Map.<string, AnimationClip>>

getCachedClip(name) → {AnimationClip|undefined}

Get cached clip by name

Parameters:
Name Type Description
name string

The animation name

Source:
Returns:

The cached clip or undefined

Type
AnimationClip | undefined

parseAnimationName(name) → {Object}

Parse animation name and create clip metadata Format: [state][action][type] or [state][action]2[toState][emotion]_T

Parameters:
Name Type Description
name string

The animation name to parse

Source:
Returns:

Parsed metadata object

Type
Object