From a8540e5815269c125fbdc0c678e6d374b45ecb1f Mon Sep 17 00:00:00 2001 From: andyhall Date: Fri, 21 Apr 2023 19:02:17 +0900 Subject: [PATCH] Store a list of all current object meshes with instances in the scene --- src/lib/objectMesher.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/objectMesher.js b/src/lib/objectMesher.js index 1a366cef..84d57fae 100644 --- a/src/lib/objectMesher.js +++ b/src/lib/objectMesher.js @@ -40,6 +40,9 @@ function ObjectMesher(noa) { // mock object to pass to customMesh handler, to get transforms var transformObj = new TransformNode('') + // list of known base meshes + this.allBaseMeshes = [] + // internal storage of instance managers, keyed by ID // has check to dedupe by mesh, since babylon chokes on // separate sets of instances for the same mesh/clone/geometry @@ -53,6 +56,7 @@ function ObjectMesher(noa) { return managers[id] = managers[id2] } } + this.allBaseMeshes.push(mesh) return managers[id] = new InstanceManager(noa, mesh) }