When I bake and re-export a Blender model to my Defold project folder (overwriting the same model and texture filenames), Defold hot-reloads the asset—but the material names inside the model change. In other DCCs/engines the material names remain stable if I don’t rename them in Blender. In Defold they appear to be regenerated/renumbered, which breaks my expectations and any name-based references.
Material names are stored in the glb file on export from Blender.
Are you sure the materials/material names were the same in Blender on the second export?
According to the last image, this does not seem to be the case. Defold detected materials that are no longer present, highlighted in blue, and one that is new, “Cube.001Baked.004”.
Defold seems to remove underscores from material names though.
My guess is your other software takes what it finds in the glb file and simply overwrites old files.
In contrast, Defold needs you to manually remove redunant materials (the ones highlighted in blue) and if there is a new material, to add the path to the material file (and after that, the texture).
Maybe try this out with a simple cube in Blender - add some materials, export. Don’t rename any material, add a different image but with the same name as before, export again. All should be fine.
Next, change or rename or add a new material - export and see what happens. If you open the model file, you should see that the old materials are listed here - Defold waits for your input in the editor and only then changes the file.
At least that is my working theory of what is happening to you.
yeah, it seems like you are right. I will try few times more, but the problem is not in Defold, it`s gltf settings problem, that could be fixed by scripts for now. Thanks, i will update with any news on this topic.