Materials are duplicated to each instance even after marking as "local to scene".

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By grixm

I have a project where I have a bunch of meshes that looks the same, but needs separate material properties (for example some are colored dark because they are in the fog of war).

I had though to solve this by looping through each surface’s material on the mesh and coloring that material’s albedo darker. However, when I color the albedo of one instance, all other instances of the same scene are also colored.

I read that I need to mark the resource as “local to scene” in order not to have it share properties with other instances. However, I have done this, and the properties are still duplicated.

I have tried:

  • Marking each surface’s material on the mesh “Local to scene”.
  • Marking the mesh “Local to scene”.
  • Right-clicking each surface’s material and clicking “Make unique”
  • Right-clicking the mesh and clicking “Make unique”.

Still no luck.

When debugging the code, each mesh seems to be unique now, but not its materials.

:bust_in_silhouette: Reply From: Inces

If You create mesh or material in code, local_to_scenewon’t work.
Don’t even bother with this, create a new material in code by duplicating your parent material, and only then it will behave as it would be unique

Thanks. The mesh and material are from files, not code, so still not sure why it didn’t work. But I manually went in and duplicated it in code anyway like you said, and eventually got it to work.

grixm | 2023-04-17 06:44