I’m using babylon to load the glb model. The model is correct in the scene, but the structure of the model is not the structure I want. I feel very confused. My model obviously only has one mesh in blender. If I export it as fbx, I can get the same results as blender in unity. But when I export it as glb and use it in babylon, two meshes will appear. , will babylon automatically segment the model? But I don’t have this problem when using other models.
But it should be noted that the model is special. In blender, I generated multiple models manually through python, and used python to perform merge-qualified operations. In the end, only 1 mesh was formed in blender.
Now I’m confused, what’s the problem? How should I deal with this problem? I hope you can help me. I’m at my wits’ end. I’m just a newbie who has just come into contact with babylon.js. Thank you all in advance.
Below is the node structure diagram of the same model in my blender and babylon.
-blender
-babylon
This is not the behavior of babylonjs, but the GLTF standard. GLTF splits the plural material mesh into multiple primitive stores.
Babylonjs, on the other hand, seems to have run into a block in merging these primitives, and has therefore given up trying to merge primitives when the model is loaded.
Thank you very much for your reply, my friend. I just took a closer look and saw that I was only using one common material. Now I’m wondering how I should go about it, or how I should determine the standard of the model. Because I’m going to be a generic feature, I can’t be sure how this problem is happening, so I can’t determine my logic.
You can export the model to GLTF format and see if there are two primitives in the .gltf file, which is in JSON format.
Yes, you can upload a zip archive of your model and ask people to check it for you.
I’m a new user and can’t upload a zip file, but I put the model on git and here’s my address Assets/model.glb at main · chu987297968/Assets · GitHub Thank you for your reply, thank you very much.
This is the .gltf part that was spun off from the glb you gave, and it has two primitives that share a common material.
In this case, you can load the model in babylonjs and make sure that the materials used are the same and merge them.
https://doc.babylonjs.com/typedoc/classes/BABYLON.Mesh#MergeMeshes
You can also try to merge primitives in your modeling software.
I tried importing this model into Blender and re-exporting as glb and this primitive was automatically merged.
This is the GLB file that I re-exported after importing blender:
untitled.zip (948.6 KB)
This indicates that there is a problem with your python program.
Thank you, my friend, for your help. I kind of understand the problem. Thank you again for your help, thank you