MorphTargets

1.2.0+

Wrapper around a native set of morph targets.

Usage

const mesh = object.getComponent('mesh');
const mouthTarget = mesh.morphTargets.getTargetIndex('mouth');
mesh.setMorphTargetWeight(mouthTarget, 0.5);

Properties

Methods


Properties

.count: number

Amount of targets in this morph target set.



Methods

.getTargetIndex(name: string) ⇒ number

Get the index for a given target name.

Throws if no target with that name exists.

ParamTypeDescription
namestringName of the target.

.getTargetName(target: number) ⇒ string

Returns the name of a given target

ParamTypeDescription
targetnumber