Change mesh UVs without affecting clones

I’m trying to change the UV attributes of a mesh, but I need clones of the mesh to keep their own UVs.

As you can see in this example, both meshes get their UVs updated:

codesandbox.io/s/react-three-fiber-edit-mesh-uvs-blvyb?file=/src/App.js

I tried cloning the attributes but that didn’t work:
child.geometry.setAttribute('uv', child.geometry.getAttribute('uv').clone())

Also, I can’t use a texture offset because then I’d need to clone the texture for each mesh and that causes a significant hitch.

cloning the geometry is not an option ?

1 Like

Cloning the geometry works, thanks!