Hi, i use in Threejs a 3dsmax exporter scene in glb, but I have a small problem.
If an object has 3 material IDs, Threejs considers that it has 3 different objects, I want to specify that it has only one been the same object… Has anyone ever encountered this problem?
Yeah a lot/most of the exporters act that way… since its not obvious that threejs does actually support multiple materials per mesh, but it takes some setup… like assigning faces to draw groups. You can manually recombine them… but that’s a fiddly process…
Thing is… it’s not Really a fully duplicated mesh, (since the meshes share the same geometry), so usually, you just pretend the parent node of those meshes is “the object” and move on with your life.
The gltf exporter even creates that parent with the same name as the original mesh, and the meshes themselves get names like mesh_0, _1, etc.
It’s also generally good practice to have your scene graph interactions general/loose enough that dealing with those kinds of hierarchy differences isn’t a big deal.
Really you want to have your object/scene/graph represenation be your own thing that maps on top of the threejs scene graph. that way if you every need to use that logic without being tied to a renderer, things can still work.
The gltf exporter even creates that parent with the same name as the original mesh, and the meshes themselves get names like mesh_0, _1, etc.
Exactly my problem, i found a workaroud with Threejs to move parent and childs.
Thanks for explanations.