Add support for tracking and applying active selection ID in ViewportHost

This commit is contained in:
2026-04-15 14:47:16 +02:00
parent bc538e7918
commit e92f25de31

View File

@@ -43,6 +43,7 @@ import {
import { EffectComposer } from "postprocessing"; import { EffectComposer } from "postprocessing";
import { import {
applySameKindSelectionClick,
areEditorSelectionsEqual, areEditorSelectionsEqual,
isBrushEdgeSelected, isBrushEdgeSelected,
isBrushFaceSelected, isBrushFaceSelected,
@@ -51,6 +52,7 @@ import {
isModelInstanceSelected, isModelInstanceSelected,
isPathPointSelected, isPathPointSelected,
isPathSelected, isPathSelected,
isSelectionActiveId,
type EditorSelection type EditorSelection
} from "../core/selection"; } from "../core/selection";
import { getWhiteboxSelectionFeedbackLabel } from "../core/whitebox-selection-feedback"; import { getWhiteboxSelectionFeedbackLabel } from "../core/whitebox-selection-feedback";
@@ -429,6 +431,7 @@ export class ViewportHost {
private currentSelection: EditorSelection = { private currentSelection: EditorSelection = {
kind: "none" kind: "none"
}; };
private currentActiveSelectionId: string | null = null;
private hoveredSelection: EditorSelection = { private hoveredSelection: EditorSelection = {
kind: "none" kind: "none"
}; };
@@ -668,9 +671,14 @@ export class ViewportHost {
this.rebuildModelInstances(this.currentDocument, this.currentSelection); this.rebuildModelInstances(this.currentDocument, this.currentSelection);
} }
updateDocument(document: SceneDocument, selection: EditorSelection) { updateDocument(
document: SceneDocument,
selection: EditorSelection,
activeSelectionId: string | null
) {
this.currentDocument = document; this.currentDocument = document;
this.currentSelection = selection; this.currentSelection = selection;
this.currentActiveSelectionId = activeSelectionId;
this.setHoveredSelection({ this.setHoveredSelection({
kind: "none" kind: "none"
}); });