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
- .getTargetIndex(name) ⇒ number
- .getTargetName(target) ⇒ string
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.
| Param | Type | Description |
|---|---|---|
name | string | Name of the target. |
.getTargetName(target: number) ⇒ string
Returns the name of a given target
| Param | Type | Description |
|---|---|---|
target | number |