Strange loading of .babylon file


  1. Load .glb file
  2. Save it to .babylon file
  3. Load .babylon file

With gltf works totally fine. Can be reproduced with

I can see the same display if only doing:

let scene = await BABYLON.SceneLoader.LoadAsync("", "Demo_%D1%81%D0%B1%D0%BE%D1%80%D0%BA%D0%B0.glb", engine);

than if executing the whole PG(?)

Did you create camera?

let scene = await BABYLON.SceneLoader.LoadAsync("", "Demo_%D1%81%D0%B1%D0%BE%D1%80%D0%BA%D0%B0.glb", engine);
scene.createDefaultCameraOrLight(true, true, true);

I found that some instances of scene.geometries have same id. So different meshes reference same geometry.
Not sure is this a problem, but gltf export/import handles this well.

I didn’t create the camera indeed.

I don’t know if having the same geometry id for multiple geometries is supposed to work when loading/saving to a .babylon file. @Deltakosh ?

1 Like

I am not seeing the same IDs:

strange babylon file load | Babylon.js Playground (

They all seem to be unique.

I am not saying there is nothing wrong, I am just saying that this is probably not the issue :slight_smile:

1 Like

Totally not an issue for me, at least. I am just setting id by myself now.

Sorry, I don’t follow. You said earlier that the IDs are not unique (i.e. same IDs), and I said - I can’t seem to find those duplicated geometries. I just said it is probably not the issue.

Sorry, misunderstood.
I guess, I have no idea what is happening…
I changed ids on geometries, like that
scene.geometries.forEach(x => = ((Math.random() * 100000) | 0).toString());
Now it yields different result, but still lost some windows :skull_and_crossbones:

OK, now I get it.
I had a lot of nodes with same ids (specific of my project). = node.uniqueId helps