Capítulo 576 de 859

Chapter 576: MorphBlendMesh

Core Idea

A special type of an animated mesh with a more advanced interface for animation playback. Unlike MorphAnimMesh. It allows to playback more than one morph animation at the same time but without fading options.

Key Concepts

  • animationsList : Array.<Object>: A list of animations.
  • animationsMap : Object.<string, Object>: A dictionary of animations.

Code Examples

import { MorphBlendMesh } from 'three/addons/misc/MorphBlendMesh.js';
  • What it demonstrates: Typical usage of MorphBlendMesh.

Reference Tables

Constructor

Signature
`new MorphBlendMesh( geometry : BufferGeometry, material : Material

Properties

PropertyDescription
.animationsList : Array.<Object>A list of animations.
.animationsMap : Object.<string, Object>A dictionary of animations.

Methods

MethodDescription
.autoCreateAnimations( fps : number )Automatically creates animations based on the values in Mesh#morphTargetDictionary.
.createAnimation( name : string, start : number, end : number, fps : number )Creates a new animation.
.getAnimationDuration( name : string ) : numberReturns the duration for the defined animation.
.getAnimationTime( name : string ) : numberReturns the time for the defined animation.
.playAnimation( name : string )Plays the defined animation.
.setAnimationDirectionBackward( name : string )Sets the animation playback direction to "backward" for the defined animation.
.setAnimationDirectionForward( name : string )Sets the animation playback direction to "forward" for the defined animation.
.setAnimationDuration( name : string, duration : number )Sets the duration to the given value for the defined animation.
.setAnimationFPS( name : string, fps : number )Sets the FPS to the given value for the defined animation.
.setAnimationTime( name : string, time : number )Sets the time to the given value for the defined animation.
.setAnimationWeight( name : string, weight : number )Sets the weight to the given value for the defined animation.
.stopAnimation( name : string )Stops the defined animation.
.update( delta : number )Updates the animations of the mesh.

Key Takeaways

  1. MorphBlendMesh extends: EventDispatcher → Object3D → Mesh
  2. Most relevant properties: animationsList, animationsMap.
  3. Key methods: autoCreateAnimations, createAnimation, getAnimationDuration, getAnimationTime.

Connects To