How to read thinInstanceBuffer data from a Mesh?

Hello :slight_smile:

In the Methods of Mesh (Mesh Doc), I use Mesh.thinInstanceSetBuffer but what the equivalent for reading ? My problem is that I’m working with GLBs which have been exported from BabylonJS in a scene with ThinInstances. They load well in a new BabylonJS scene, and are automatically loaded as ThinInstances (great ! :slight_smile: ) but how can I read back the buffer in order to edit ?

Edit : I have seen about the Mesh.thinInstanceGetWorldMatrices which I guess would work for the transforms, but in my case I also need to read back other buffer such as color, set before GLB export by mesh.thinInstanceSetBuffer("instanceColor", buffer, 3);

Thin instance buffers are regular vertex buffers, so you can get them by doing mesh.getVerticesData() or mesh.getVertexBuffer().

For example:

https://playground.babylonjs.com/?inspectorv2=true#V1JE4Z#263

1 Like