Spamming Warning on InstancedMesh clone

Hi !

Not really a bug, but still an unwanted behavior.

Every time an instance of InstancedMesh is cloned using the clone method, following warning is logged :

Cannot set property geometry of [object Object] which has only a getter

Here is a PG : Babylon.js Playground

I believe this happens since BJS 7.35.0 and is linked to TypeScript version update.

A bit too deep in BJS internal mechanism for me, but maybe a key should be added to the doNotCopyList parameter when DeepCopier.DeepCopy is called in the clone method ?

Thanks a lot for the amazing work !

You were right, a property (“geometry”) had to be added to the doNotCopyList list.

This PR will fix the problem:

5 Likes

Thanks a lot for the quick answer and PR ! :clap: