ThatOpen/web-ifc-viewer

IfcSelection Error: Cannot read properties of undefined (reading 'mesh')

thesn10 opened this issue · 3 comments

Rendering the model works fine, but when doing a selection, i get the following error:
Screenshot 2023-06-23 at 12 31 16

But as you can see, mesh and geometry is not undefined in the IFCModel:
Screenshot 2023-06-23 at 13 35 48

the cause seems to be that there is a model id mismatch between
state.models[].modelID (= 0)
and
state.models[].mesh.modelID (= 1)
as you can see here
Screenshot 2023-06-23 at 14 32 30

Hey, are you using different instances of web-ifc-three / web-ifc-viewer, or using web workers to load models in parallel? If you are loading multiple models, are you awaiting the first to load before loading the second one?

Yes, thanks! I was using Angular and a component rerender triggered the model loading twice
Issue is gone now, thanks!