# Restore All Materials

**URL:** <https://forums.unrealengine.com/t/restore-all-materials/434025>\
**Category:** Rendering\
**Tags:** slot, override, unreal-engine, question\
**Created:** [September 18, 2018, 9:00pm UTC](https://forums.unrealengine.com/t/restore-all-materials/434025 "2018-09-18T21:00:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brothermechanic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brothermechanic](https://forums.unrealengine.com/u/brothermechanic)\
**Post date:** [September 18, 2018, 9:00pm UTC](https://forums.unrealengine.com/t/restore-all-materials/434025/1 "2018-09-18T21:00:16Z")

</div>

Hello

Help me to restore all materials of my level.

 ![254017-screenshot-20180918-235416.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/a/36aa3cf2b8635e42026461ef6aa4612bf732c0e6.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 18, 2018, 9:22pm UTC](https://forums.unrealengine.com/t/restore-all-materials/434025/2 "2018-09-18T21:22:49Z")

</div>

Perhaps you should look into [material param collection](https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/ParameterCollections) 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.

---

<div class="post-metadata">

**Author:** ![brothermechanic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brothermechanic](https://forums.unrealengine.com/u/brothermechanic)\
**Post date:** [September 18, 2018, 9:38pm UTC](https://forums.unrealengine.com/t/restore-all-materials/434025/3 "2018-09-18T21:38:24Z")

</div>

Hm…  
Black - just for example

In real game this was radically different material

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

---

<div class="post-metadata">

**Author:** ![brothermechanic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brothermechanic](https://forums.unrealengine.com/u/brothermechanic)\
**Post date:** [September 19, 2018, 7:00am UTC](https://forums.unrealengine.com/t/restore-all-materials/434025/4 "2018-09-19T07:00:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CKong](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CKong](https://forums.unrealengine.com/u/CKong)\
**Post date:** [September 19, 2018, 7:27am UTC](https://forums.unrealengine.com/t/restore-all-materials/434025/5 "2018-09-19T07:27:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brothermechanic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brothermechanic](https://forums.unrealengine.com/u/brothermechanic)\
**Post date:** [September 19, 2018, 8:23am UTC](https://forums.unrealengine.com/t/restore-all-materials/434025/6 "2018-09-19T08:23:24Z")

</div>

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