From 91d88f1e0553ade2b9a4dfcfbbd1bbcd0e4036a5 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 01:39:47 +0200 Subject: [PATCH] Add setVisibility method to RuntimeInteractionDispatcher and update handling in RuntimeInteractionSystem --- .../runtime-interaction-system.ts | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/runtime-three/runtime-interaction-system.ts b/src/runtime-three/runtime-interaction-system.ts index 68a4b96f..25323e58 100644 --- a/src/runtime-three/runtime-interaction-system.ts +++ b/src/runtime-three/runtime-interaction-system.ts @@ -5,7 +5,9 @@ import { } from "../interactions/interaction-links"; import { getInteractionLinkImpulseSteps, - type ImpulseSequenceStep + type ImpulseSequenceStep, + type SequenceVisibilityMode, + type SequenceVisibilityTarget } from "../sequencer/project-sequence-steps"; import type { @@ -35,6 +37,11 @@ export interface RuntimeInteractionDispatcher { visible: boolean | undefined, link: InteractionLink ): void; + setVisibility?( + target: SequenceVisibilityTarget, + mode: SequenceVisibilityMode, + link: InteractionLink + ): void; playAnimation( instanceId: string, clipName: string, @@ -759,6 +766,25 @@ export class RuntimeInteractionSystem { link ); return; + case "setVisibility": + if (dispatcher.setVisibility !== undefined) { + dispatcher.setVisibility(step.target, step.mode, link); + return; + } + + if (step.target.kind === "brush") { + dispatcher.toggleBrushVisibility( + step.target.brushId, + step.mode === "toggle" ? undefined : step.mode === "show", + link + ); + return; + } + + throw new Error( + "Runtime visibility steps targeting model instances require dispatcher.setVisibility support." + ); + return; case "startDialogue": dispatcher.startDialogue(step.dialogueId, { kind: "interactionLink",