In three.js, a THREE.Mesh is a subclass of THREE.Object3D, and so meshes appear directly in the scene graph. In glTF, meshes are resources that can be attached to any ‘node’, more like a BufferGeometry in three.js. So I think the name of your mesh has been attached to the glTF “node” and not the glTF “mesh” here — if you open the file you’ll see three named nodes: “Cube”, “Camera”, and “Light”.
I assume my best approach is to add mesh names to the GLTF JSON object and convert it to GLB. I know glTFVariantMeld is out of the ThreeJS, but appreciate it if you have any suggestions.
Editing the JSON “meshes” entries should be fine. Another option would be to run a script like this in the https://gltf.report script editor, applying the node names to the meshes:
const scene = document.getRoot().listScenes()[0];
scene.traverse((node) => {
const name = node.getName();
const mesh = node.getMesh();
if (mesh && name) {
mesh.setName(name);
}
});