From f981efde61e19273c76218a6c6e7e91718940d33 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 1 Apr 2026 00:02:23 +0200 Subject: [PATCH] Add play and stop animation actions in runtime interaction system and update scene build to include animation properties --- src/runtime-three/runtime-interaction-system.ts | 6 ++++++ src/runtime-three/runtime-scene-build.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runtime-three/runtime-interaction-system.ts b/src/runtime-three/runtime-interaction-system.ts index f485e488..c8d6663e 100644 --- a/src/runtime-three/runtime-interaction-system.ts +++ b/src/runtime-three/runtime-interaction-system.ts @@ -214,6 +214,12 @@ export class RuntimeInteractionSystem { case "toggleVisibility": dispatcher.toggleBrushVisibility(link.action.targetBrushId, link.action.visible, link); break; + case "playAnimation": + dispatcher.playAnimation(link.action.targetModelInstanceId, link.action.clipName, link); + break; + case "stopAnimation": + dispatcher.stopAnimation(link.action.targetModelInstanceId, link); + break; } } } diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index 7a740c6c..a84c7378 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -224,7 +224,9 @@ function buildRuntimeModelInstance(modelInstance: SceneDocument["modelInstances" name: modelInstance.name, position: cloneVec3(modelInstance.position), rotationDegrees: cloneVec3(modelInstance.rotationDegrees), - scale: cloneVec3(modelInstance.scale) + scale: cloneVec3(modelInstance.scale), + animationClipName: modelInstance.animationClipName, + animationAutoplay: modelInstance.animationAutoplay }; }