diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 4f554ba0..023104ef 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -419,6 +419,9 @@ export class ViewportHost { updateDocument(document: SceneDocument, selection: EditorSelection) { this.currentDocument = document; this.currentSelection = selection; + this.setHoveredSelection({ + kind: "none" + }); this.rebuildLocalLights(document); this.rebuildBrushMeshes(document, selection); this.rebuildEntityMarkers(document, selection); @@ -458,6 +461,11 @@ export class ViewportHost { this.brushSelectionChangeHandler = handler; } + setWhiteboxHoverLabelChangeHandler(handler: ((label: string | null) => void) | null) { + this.whiteboxHoverLabelChangeHandler = handler; + this.emitWhiteboxHoverLabelChange(); + } + setCreationPreviewChangeHandler(handler: ((toolPreview: ViewportToolPreview) => void) | null) { this.creationPreviewChangeHandler = handler; } @@ -510,6 +518,21 @@ export class ViewportHost { this.applyTransformPreview(); } + setWhiteboxSelectionMode(mode: WhiteboxSelectionMode) { + if (this.whiteboxSelectionMode === mode) { + return; + } + + this.whiteboxSelectionMode = mode; + this.lastClickPointer = null; + this.lastClickSelectionKey = null; + this.setHoveredSelection({ + kind: "none" + }); + this.refreshBrushPresentation(); + this.syncTransformGizmo(); + } + setTransformSession(transformSession: TransformSessionState) { this.currentTransformSession = cloneTransformSession(transformSession); @@ -537,6 +560,9 @@ export class ViewportHost { this.toolMode = toolMode; this.lastClickPointer = null; this.lastClickSelectionKey = null; + this.setHoveredSelection({ + kind: "none" + }); if (toolMode !== "create") { this.syncCreationPreview(null); @@ -551,6 +577,9 @@ export class ViewportHost { this.viewMode = viewMode; this.lastClickPointer = null; this.lastClickSelectionKey = null; + this.setHoveredSelection({ + kind: "none" + }); this.applyViewModePose();