fix: texture mapping in JuiceBox and node deletion bug in hierarchy
Build and Deploy / build-and-push (push) Failing after 20s
Build and Deploy / build-and-push (push) Failing after 20s
This commit is contained in:
@@ -244,6 +244,18 @@ export const ModelViewer = forwardRef<THREE.Group, ModelViewerProps>(({ object,
|
||||
}
|
||||
}, [object, sceneObjects]);
|
||||
|
||||
// Hide deleted meshes
|
||||
useEffect(() => {
|
||||
if (object && sceneObjects) {
|
||||
const activeIds = new Set(sceneObjects.map(obj => obj.id));
|
||||
meshCache.current.forEach((mesh, id) => {
|
||||
if (!activeIds.has(id)) {
|
||||
mesh.visible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [object, sceneObjects]);
|
||||
|
||||
if (!object) return null;
|
||||
|
||||
const meshObjects = sceneObjects.filter(obj => obj.type === 'mesh');
|
||||
|
||||
Reference in New Issue
Block a user