From 2f9097b3f21b7c6636e17ab758a240f524de7048 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 1 Apr 2026 00:07:25 +0200 Subject: [PATCH] Add animation support to RuntimeHost --- src/runtime-three/runtime-host.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index 4bd973c0..c6c830cd 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -367,6 +367,19 @@ export class RuntimeHost { this.modelGroup.add(renderGroup); this.modelRenderObjects.set(modelInstance.instanceId, renderGroup); + + if (loadedAsset?.animations && loadedAsset.animations.length > 0) { + const mixer = new AnimationMixer(renderGroup); + this.animationMixers.set(modelInstance.instanceId, mixer); + this.instanceAnimationClips.set(modelInstance.instanceId, loadedAsset.animations); + + if (modelInstance.animationAutoplay === true && modelInstance.animationClipName) { + const clip = AnimationClip.findByName(loadedAsset.animations, modelInstance.animationClipName); + if (clip) { + mixer.clipAction(clip).play(); + } + } + } } }