So, I am trying to set a glb mesh in the editor and probably later at runtime. Based on my current experience with the editor it looks like the only way I can get a glb into the scene is by either dragging and dropping a glb directly (and I can’t attach a script nor can I change the mesh) or by creating a child scene of the glb (which allows for the script but I still can’t change the mesh). The image above is the load dialog for the mesh in meshinstance3d, it appears that Godot does not fully support .glb files. I see that .obj files are supported. I haven’t used those before, and it seems that all the online traffic is saying to use .glb due to the features available. Are there plans to support .glb fully in Godot?
.glb is not just a mesh. It’s a blender format [ glTF ] file that can contain an entire blender project. ( It can contain: 3D scenes, models, lighting, materials, and animations )
I would try to open the .glb as its own scene then try to save the mesh into its own mesh resource. Godot doesn’t like separating the resources from the file but it knows how to read them. I haven’t played with extracting much.
The .glb files are the binary representation of GLTF files. It is a widely used model format that Blender supports (as does Godot), but they are not Blender project files. There are, for example, Blender features that GLTF/glb does not support (such as face maps), so they cannot contain an entire Blender project.
Dragging the .glb model into a scene is the best way to use it. After one is in your scene, right click on it and select “Make Children Editable”. Repeat as needed. I think (but I wouldn’t swear to it), that the mesh data is accessible at that point (SurfaceTool, maybe?).
It could be a simple blender project… But you are right. I apologize for my association with the file being of Blender. ( My introduction to the format was through Godot and Blender. )
When importing a gltf, you can have Godot save the mesh.
Save to File: Saves the Mesh resource to an external file (this isn’t a scene file). You generally don’t need to use this for placing the mesh in a 3D scene – instead, you should instance the 3D scene directly. However, having direct access to the Mesh resource is useful for specific nodes, such as MeshInstance3D
You can then use that mesh for MeshInstance3D
Also, you can make import scripts if you have a more complicated process you need to automate
Now, personally, I have a script where I extract the meshes, add the specific nodes I want, arrange them as I need and save it as a scene so I can easily edit it in the editor.
If you double click on the .glb file, it should open an advanced import menu in a new window. In the top left corner of that window is a button called Actions, and one of the actions is Set mesh save paths, which lets you pick a directory where each mesh from the .glb file will be saved as its own resource.
Also, if you just drag and drop the glb into a scene, you should be able to right click and select “editable children” where you could then modify the underlying nodes etc…
Thank you, this is what I was searching in vain for. Not exactly intuitive, but it works. This will ease my workflow a bit by allowing my mesh scenes to not be fixed to a particular glb and so I can make a template scene for objects.