Hey,
I recently found out that GLTFLoader changes the names of the meshes.
Simple example:
AB.zip
There's a gltf file in the zip. If you open it up with a text editor, you can see that it has one mesh in it, with the following name: A / B.
If you load it with GLTFLoader, that name becomes A__B (you can try here, see the console: https://gltf-viewer.donmccurdy.com/ )
So space () becomes underscore (_), while slash (/) gets simply removed.
Is this a bug, or is there a valid reason why this is happening?
@donmccurdy ?
This is related to the sanitization of node names in context of the animation system's property binding.
That's correct – we alter the names so that they're compatible with the three.js animation system.
If you're trying to preserve specific data for each object in your application, you could also use "Custom Properties" in Blender, with that option enabled in the export settings. Your custom key/value data will be set on the objects as mesh.userData.*.
Ok, got it, thanks! :)
Most helpful comment
That's correct – we alter the names so that they're compatible with the three.js animation system.
If you're trying to preserve specific data for each object in your application, you could also use "Custom Properties" in Blender, with that option enabled in the export settings. Your custom key/value data will be set on the objects as
mesh.userData.*.