Update syncModelInstanceSelectionShell to return the selection shell or null
This commit is contained in:
@@ -165,7 +165,7 @@ export function syncModelInstanceSelectionShell(
|
|||||||
group: Group,
|
group: Group,
|
||||||
asset: ProjectAssetRecord | undefined,
|
asset: ProjectAssetRecord | undefined,
|
||||||
selected: boolean
|
selected: boolean
|
||||||
) {
|
): Mesh | null {
|
||||||
const existingShells = group.children.filter(
|
const existingShells = group.children.filter(
|
||||||
(child): child is Mesh =>
|
(child): child is Mesh =>
|
||||||
child instanceof Mesh &&
|
child instanceof Mesh &&
|
||||||
@@ -178,7 +178,7 @@ export function syncModelInstanceSelectionShell(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!selected) {
|
if (!selected) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bounds = getLocalModelBounds(asset);
|
const bounds = getLocalModelBounds(asset);
|
||||||
@@ -192,6 +192,7 @@ export function syncModelInstanceSelectionShell(
|
|||||||
selectionShell.userData.nonPickable = true;
|
selectionShell.userData.nonPickable = true;
|
||||||
selectionShell.userData[MODEL_SELECTION_SHELL_KEY] = true;
|
selectionShell.userData[MODEL_SELECTION_SHELL_KEY] = true;
|
||||||
group.add(selectionShell);
|
group.add(selectionShell);
|
||||||
|
return selectionShell;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createModelInstanceRenderGroup(
|
export function createModelInstanceRenderGroup(
|
||||||
|
|||||||
Reference in New Issue
Block a user