# Mesh setVerticesData sets values for all duplicate meshes

**URL:** <https://forum.babylonjs.com/t/mesh-setverticesdata-sets-values-for-all-duplicate-meshes/24208>\
**Category:** Questions\
**Created:** [September 30, 2021, 1:42pm UTC](https://forum.babylonjs.com/t/mesh-setverticesdata-sets-values-for-all-duplicate-meshes/24208 "2021-09-30T13:42:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charge](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Charge](https://forum.babylonjs.com/u/Charge)\
**Post date:** [September 30, 2021, 1:42pm UTC](https://forum.babylonjs.com/t/mesh-setverticesdata-sets-values-for-all-duplicate-meshes/24208/1 "2021-09-30T13:42:49Z")

</div>

Hi,  
In my application I need to change the skeleton that a loaded .babylon file uses. In addition, I need to change the indices of the bones.  
To do this, I use:

> const indices = myMesh.getVerticesData(VertexBuffer.MatricesIndicesKind);

To get the values, which are then updated and re-applied with:

> myMesh.setVerticesData(VertexBuffer.MatricesIndicesKind, indices, false);

This all works well.

However, If I re-load another copy of the mesh, then it seems that the indices of the newly-loaded mesh have already been updated, indicating that in fact, I am being given a copy of the mesh in memory. I understand that this is an optimisation, but given I had edited the indices, I was expecting that re-loading the mesh would give me a clean copy.

In addition, if I clone the mesh and edit the clone’s indices, it seems that the original indices are also adjusted.

As I want to load a mesh multiple times and adjust each copy’s indices differently so that it can be applied to a different skeleton I will need to be able to have copies of the same mesh, each with different bone indices.

Has anyone got any ideas on how this can be achieved?  
Thanks.

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [September 30, 2021, 9:31pm UTC](https://forum.babylonjs.com/t/mesh-setverticesdata-sets-values-for-all-duplicate-meshes/24208/2 "2021-09-30T21:31:22Z")

</div>

Hi @Charge

Before you start changing vertices, applying

> Mesh.makeGeometryUnique();

Should fix both those issues
