Hi, in my webapp, the user can upload a glb file, to be rendered as a particle in a SPS.
When the model has only one mesh with a single material, it’s working by getting the first child of the imported “__root__” element.
But when the model is more complex, with multiple meshes/materials, I couldn’t find out how to use it in the SPS.
See in the playground I’ve created: https://playground.babylonjs.com/#M6HVAX#6
- If I try to add the “__root__” mesh direcly into the SPS and exception is thrown (“object null is not iterable”).
- if I try to add the first mesh of the root in the SPS, only the first mesh is added, the childrens are not added to the SPS automatically
- If I try to merge the childrens of “__root__” into a single mesh, the merged meshed seems to be ok, but when adding it on the SPS, it only works (in part, since the other materials are lost) when setting multiMaterials = false. If multiMaterials = true, the particle is not drawn.
So, is there a proper way to import a model from a file and use it in the SPS?
I’ve created 3 models with different structures to test (the urls are in in the playground), below the structure of the nodes as shown in the sandbox:
sample_multi_shapes_nested.glb
sample_multi_shapes.glb
sample_single_shape.glb