# Imported meshes appear broken if they have the same geometry uniqueId

**URL:** <https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567>\
**Category:** Bugs\
**Tags:** geometry, import\
**Created:** [August 31, 2022, 5:00pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567 "2022-08-31T17:00:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![reb-ic](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/reb-ic/32/18481_2.png) [@reb-ic](https://forum.babylonjs.com/u/reb-ic)\
**Post date:** [August 31, 2022, 5:00pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/1 "2022-08-31T17:00:30Z")

</div>

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.

 ![Schermata del 2022-08-31 18-18-42](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/6/d639ad1704db840646542c30aed65b5ca76c7b44.png)

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

 ![Schermata del 2022-08-31 18-22-35](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/0/d041aff0b8da4509efa6fad2757d35d5808c274b.png)

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

 ![Schermata del 2022-08-31 18-16-46](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/e/5ecbcbddb966c9f93b3dac563ee0b60cc30efcfd.png)

I created these playgrounds to show this behavior:

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

Import meshes serialized with babylon 4:  
[https://playground.babylonjs.com/#MVCM5J](https://playground.babylonjs.com/#MVCM5J)

Serialized scene:  
[https://playground.babylonjs.com/#6XIT28#3000](https://playground.babylonjs.com/#6XIT28#3000)  
[https://playground.babylonjs.com/#WIR77Z#1567](https://playground.babylonjs.com/#WIR77Z#1567)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 31, 2022, 5:33pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/2 "2022-08-31T17:33:18Z")

</div>

Assigned @carolhmj on August 31, 2022, 5:33pm UTC



---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 31, 2022, 5:35pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/3 "2022-08-31T17:35:01Z")

</div>

@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 🙂

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [September 5, 2022, 7:11pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/4 "2022-09-05T19:11:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [September 5, 2022, 7:11pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/5 "2022-09-05T19:11:30Z")

</div>

Unassigned @carolhmj on September 5, 2022, 7:11pm UTC



---

<div class="post-metadata">

**Author:** ![reb-ic](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/reb-ic/32/18481_2.png) [@reb-ic](https://forum.babylonjs.com/u/reb-ic)\
**Post date:** [September 15, 2022, 9:59am UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/6 "2022-09-15T09:59:29Z")

</div>

Hi @carolhmj, thank you very much 😃

---

<div class="post-metadata">

**Author:** ![davidworkman9](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/davidworkman9/32/2373_2.png) [@davidworkman9](https://forum.babylonjs.com/u/davidworkman9)\
**Post date:** [January 30, 2023, 3:14pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/7 "2023-01-30T15:14:59Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 30, 2023, 3:47pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/8 "2023-01-30T15:47:47Z")

</div>

Can you provide us with a repro?

---

<div class="post-metadata">

**Author:** ![davidworkman9](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/davidworkman9/32/2373_2.png) [@davidworkman9](https://forum.babylonjs.com/u/davidworkman9)\
**Post date:** [January 30, 2023, 10:51pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/9 "2023-01-30T22:51:39Z")

</div>

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:

> **[Babylon.js Playground](https://playground.babylonjs.com/#MVCM5J%233)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Box first:

> **[Babylon.js Playground](https://playground.babylonjs.com/#MVCM5J%234)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

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

 ![Screenshot 2023-01-30 at 7.13.00 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/d/9d77e7e15e4a7e1bb73f99cf2f84dea4ee72c924.png)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 31, 2023, 6:02pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/10 "2023-01-31T18:02:47Z")

</div>

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)](https://github.com/BabylonJS/Babylon.js/pull/13489) 😃

---

<div class="post-metadata">

**Author:** ![davidworkman9](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/davidworkman9/32/2373_2.png) [@davidworkman9](https://forum.babylonjs.com/u/davidworkman9)\
**Post date:** [February 1, 2023, 2:27pm UTC](https://forum.babylonjs.com/t/imported-meshes-appear-broken-if-they-have-the-same-geometry-uniqueid/33567/11 "2023-02-01T14:27:07Z")

</div>

Thank you @carolhmj!
