InstancedMeshes cloned from AssetContainer - set new source?

Say, we loaded an AssetContainer containing a Mesh A and an InstancedMesh B, where A is the source mesh of B.

When cloning both A and B into the scene, the cloned InstanceMesh obviously still references the original Mesh A, while it should reference the cloned Mesh.

Of course this is not happening automatically, but - is there an easy fix for it? Like, finding the clone on the scene and editing the instance with a reference to it?

Thats an interesting philosophical question :slight_smile:
Is the cloned instancedmesh sourced from the clone, or the original mesh it was instanced from? At the moment it is option B, but i assume it would make sense, in that case, to allow changing the source mesh.

The clone function of instancedmesh generate a new instance from the current source mesh, which is the base of this issue. We could add a way to override the sourceMesh and define a new one when cloning. @Deltakosh , wondering what your thoughts are here, when you have the time

3 Likes

I work on the same project as @hschmiedhofer and would just like to add that this is the second time we’re running into this kind of problem with different underlying use cases.

Having @RaananW s described option to change an InstancedMeshes source when cloning it, would be a very welcome feature for us!

2 Likes

I believe it would make sense for a cloned mesh. Actually, I didn’t even know of this restriction. If by any means possible, in the logic, a clone (vs an instance) should definitely be the new source. (my opinion only).

1 Like

Just wanted to add - here is my suggestion for a solution to this issue:

Will wait for reviews

1 Like