From 2e45153b8faa3cd0c56224ef952a910fac69306b Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 16:49:54 +0000 Subject: [PATCH] Changes Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com> --- src/components/three/ModelViewer.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/three/ModelViewer.tsx b/src/components/three/ModelViewer.tsx index a7ad651..a6d95f7 100644 --- a/src/components/three/ModelViewer.tsx +++ b/src/components/three/ModelViewer.tsx @@ -712,6 +712,7 @@ function SelectionHandler() { if (o.geometry instanceof THREE.PlaneGeometry) return false; return true; }); + console.log('[Selection] click', { intersects: intersects.length, hit: !!hit, hitName: hit?.object?.name, hitUserData: hit?.object?.userData }); if (!hit) return; // Walk up to find ifcElement node AND the GLBModel root (carrying modelId) @@ -723,11 +724,13 @@ function SelectionHandler() { if (!modelId && cur.userData?.modelId) modelId = cur.userData.modelId as string; cur = cur.parent; } + console.log('[Selection] walked', { foundIfcElement: !!element, modelId, elementName: element?.name }); // Non-IFC fallback: pick the mesh itself if (!element) element = hit.object; if (!modelId) modelId = useModelStore.getState().activeModelId; - if (!modelId || !element) return; + if (!modelId || !element) { console.log('[Selection] aborted: no modelId/element'); return; } const key = elementKey(modelId, element); + console.log('[Selection] toggling', key); useModelStore.getState().toggleElementSelection(key); };