Animation
vue-vrm plays VRMA files, the animation format for VRM. Like models, animations are passed as ArrayBuffer.
Playing a VRMA file
Set animation-data after (or together with) model-data:
The animation starts as soon as it is loaded. When the model changes, the current animation is applied to the new model.
Free VRMA files are available from VRoid Project on BOOTH. Check the license of each file before distributing it.
Blending several clips
Pass an array of buffers to play several clips at once. animation-weights sets the weight of each clip:
- When
animation-weightsis omitted, or its length does not match the number of clips, every clip gets the same weight. - The weights must not add up to more than
1.0. Otherwiseanimation:erroris emitted.
Looping
Animations loop by default. Set loop to false to play once. The last frame is kept, and animation:end is emitted when the clip finishes.
Playback control
Control playback through the instance API:
Each method emits the matching event: animation:pause, animation:resume, and animation:stop.