I have an interior visualization I’m working on for a client and they have two different schemes of the same space. I’m wondering is there a simple blueprint using a keystroke to swap the materials from scheme a to scheme b rather than building two separate levels?
Ideally pressing 1 would show the materials for scheme 1 and and pressing 2 would show materials for scheme 2 (or whatever keystroke makes sense).
I know how to apply a keystroke to change a material on one object but unsure on how to apply it to multiple objects.
You can plug multiple different targets into one “Set Material” node; as many as you want. If you want each object to have it’s own different materials for scheme 1 and scheme 2, then it’s a bit more complicated and there are a bunch of different ways you could do that.
The first way that comes to my mind is to use a blueprint interface. You just need one function “Switch Color Schemes”, with a bool input for scheme 1 or scheme 2. When you get the keystroke input in your controller, “Get All Actors with Interface”, and For Each of those, call your Switch Color Scheme function.
Then, in each object that needs to change color:
Implement the interface
Make two variables to store the scheme 1 and scheme 2 materials.
On “Event Switch Color Schemes”, branch for the bool input and set the material on your mesh to the appropriate material variable.
I made quite simple example of blueprint and all communication that swaps light color.
You can modify it to search for meshes instead of lights and modify instanced material.
It uses components dispatcher and enum (to make groups). To change light color all you need to do is drop component on that light, and select group it belongs to. Your version for charging materials would be bit more complicated, but not that much.
I am also interested in doing something like this. I need to have a control board kind of which would be the keyboard. So that I could change materials for my client on the fly while they are looking at stuff in VR. Nawrot, would it be possible for you to relink the lightmanger file you had?