Restore All Materials

Hello

Help me to restore all materials of my level.

I need termopary override all static meshes materials to single specific material, for example “Black”

Then restore all materials as it was before.

My blueprint works on actors with single material slot

This is hard to me when actors has many materials slots

Please, give me an advice how to solve this task.

Thank you.

Perhaps you should look into material param collection instead.

Think of it as if it was a global variable that can be applied to many materials at once. Rather than replacing all materials and restoring them, you could use a single vector to change their look - turn them black, for example.

Hm…
Black - just for example

In real game this was radically different material

And my idea is don’t change all material’s shaders

From the top of my head, I would create a structure, which contain a variable that can reference to an actor, and 1 variable that can contain a list of material template. Then before you switch all mesh material to a single material, go through all the mesh, create a structure for each mesh to store mesh reference and that mesh list of material, store it into an array of structure and put it somewhere that can be access later. Then when you want to restore all the material, just simple go through all the mesh and all the structure again, create and assign correct material to correct mesh.

May be there is way collect and replace by every material on level, not by every actor?

can you draw simple blueprint to describe this, please)))
This is my level link text
(LOOP level in level builerint)