Duplicate models that are the same geometry

When copying a model, model 1 and model 2 have duplicate models with the same geometric shape. When adding thin instances to the model, when modifying a model 1, the instance content of model 2 will be modified at the same time.


It is recommended to add a parameter to set whether it is the same

Thank you for taking the time to look at this requirement

It is expected that thin instances are shared when you clone a mesh. If you don’t want this behavior, you should call makeGeometryUnique() on the cloned mesh.

1 Like

If Mesh can solve this problem, but if it is InstanceMesh, do I need to copy the geometric data when adding thin instances?

modelClone | Babylon.js Playground (babylonjs.com)
This is my model clone, which includes the processing of the instancedMesh. It might work for you.
You can use this example directly if you are only modifying the geometry used by the mesh and not the geometry itself. If you need to modify the vertices of the geometry, you also need to clone the new geometry for the cloned mesh.

You can’t have thin instances on a instanced mesh, these are mutually exclusive. See also Meshes with thin instances don't render normal instances - #2 by Evgeni_Popov