Strange loading of .babylon file

Script:

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

With gltf works totally fine. Can be reproduced with sandbox.babylonjs.com

https://playground.babylonjs.com/#VVRV43

I can see the same display if only doing:

let scene = await BABYLON.SceneLoader.LoadAsync("https://dl.dropboxusercontent.com/s/fntb4u12p9ir7nk/", "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("https://dl.dropboxusercontent.com/s/fntb4u12p9ir7nk/", "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 (babylonjs.com)

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.
:joy:
I guess, I have no idea what is happening…
I changed ids on geometries, like that
scene.geometries.forEach(x => x.id = ((Math.random() * 100000) | 0).toString());
Now it yields different result, but still lost some windows :skull_and_crossbones:
https://playground.babylonjs.com/#VVRV43#4

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

https://playground.babylonjs.com/#VVRV43#6

3 Likes