Instance cloning with children very slow

create two instanced mesh
make one the parent of the other
clone the parent instance
You will see the cloning takes long time
see
https://www.babylonjs-playground.com/#855KQJ#3
uncomment line 36,37
notice how long it now takes to run

It seems that the cloning of instanced mesh takes a long time if the instanced mesh has a parent which is also an instanced mesh.
As a workaround I currently remove the parent, do the clone , and then restore the parent.

I made a PR to fix this:

2 Likes

Nice.
Also an issue if the parent is a plane transform node. You might want to check that

Just checked; it fixes that bug as well

2 Likes