Imported meshes appear broken if they have the same geometry uniqueId

Hi,
i noticed that when i load two models serialized in the .babylon format (with babylonjs 5), if the meshes has the same geometry uniqueId in the own .babylon file, at the second imported mesh is assigned the geometry of the first imported mesh and appears broken.

The geometry data of the second mesh are anyway loaded in the scene gemometries list.

This behaviour not occurs with the meshes serialized with babylonjs 4 which does not export the geometry uniqueId.

I created these playgrounds to show this behavior:

Import meshes serialized with babylon 5:
https://playground.babylonjs.com/#MVCM5J#1

Import meshes serialized with babylon 4:
https://playground.babylonjs.com/#MVCM5J

Serialized scene:
https://playground.babylonjs.com/#6XIT28#3000
https://playground.babylonjs.com/#WIR77Z#1567

Thanks in advance!

@carolhmj same as the texture last time, if it does not seem to be related to the latest changes, let me know and I ll assign it to me :slight_smile:

PR merged, will be on next version :slight_smile: Clear some values used during loading at the end of the load by carolhmj · Pull Request #12946 · BabylonJS/Babylon.js (github.com)

1 Like

Hi @carolhmj, thank you very much :smiley:

1 Like

I’m still experiencing this behaviour myself. Tried the latest (v5.44.0) for both the server side routine that generates the babylon file and the scene on the front end (using importMeshAsync).

Can you provide us with a repro?

1 Like

Using importMesh instead of Append with the same meshes as above causes some issues, specifically the first mesh loaded in is the only one that is visible. Not the same as I’m seeing with my own app(I see multiple meshes with the same geometry). But perhaps related?

Sphere first:

Box first:

EDIT: sorry it is the same behaviour, I didn’t know about the inspector at first.

Hey thanks, I validated that there’s a bug and opened a fix: Fix ImportMesh of babylon files that share a geometry uniqueId by carolhmj · Pull Request #13489 · BabylonJS/Babylon.js (github.com) :smiley:

3 Likes

Thank you @carolhmj!

1 Like