Atlaslog
Atlaslog / three.js / API reference / AnimationMixer
three.js · API reference

AnimationMixer

Quick answer

AnimationMixer binds AnimationClips to an object hierarchy and advances their playback over time. You create actions with clipAction(), play them, and call update(deltaTime) every frame in seconds, making it the entry point for glTF or FBX skeletal animation. Use it whenever a loaded model contains clips that must loop, blend, or cross-fade.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.AnimationMixer ( rootObject )
Key points
Example
const loader = new GLTFLoader();

loader.load('/models/escalator.glb', function (gltf) {
  scene.add(gltf.scene);

  const mixer = new THREE.AnimationMixer(gltf.scene);

  gltf.animations.forEach(function (clip) {
    const action = mixer.clipAction(clip);
    action.setLoop(THREE.LoopRepeat, Infinity);
    action.play();
  });

  mixer.addEventListener('finished', function (event) {
    console.log('播放结束', event.action.getClip().name);
  });

  clock.start();

  renderer.setAnimationLoop(function () {
    const delta = clock.getDelta();
    mixer.update(delta);
    renderer.render(scene, camera);
  });
});
const idle = mixer.clipAction(idleClip);
const walk = mixer.clipAction(walkClip);

idle.play();
walk.play();
walk.setEffectiveWeight(0);       // 先挂上,权重为 0
function blendToWalk(t) {
  walk.setEffectiveWeight(t);
  idle.setEffectiveWeight(1 - t);
}
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). AnimationMixer. https://www.jingweizhi.com/en/three/api/animation-mixer.html (accessed 2026-11-03).