A serialized mesh with TriPlanarMatériel does not create an instance afterwards


I created a rock with an IcoSpher, added a displacementMap and a triplanar material.

I serialize it, it works correctly so far. The mesh is serialized and load correctly. But I can’t create instances of mesh. only clones.

I think there is something wrong.

In this PG, I commented on the part that creates an instance and adds cloning so that you can see the result that I should obtain with the instances.

See the lines: 56 <= 59 (If you try to create instances and then look in the console there are errors: Unable to compile effect)

Thank you

Looks like the bug comes from the triplanar materials.
If I don’t use it, the instances work.

Without TriPlanarMaterial :

This PR will fix the problem:


Thanks for the fix @Evgeni_Popov