Change parameter of material in level blueprint
I want to change the parameter 'MyColor' of material 'ColorParam' in Level Blueprint to a random value every time i press '2'.
I can do this as a Blueprint actor with a mesh (Cube) defined as the input target in the construction script, like this (the Print Sting is just for debugging):
I want to get rid of the mesh connection and instead change the parameter of the material itself. Is that possible in any way?
asked Sep 17 '15 at 12:41 PM in Blueprint Scripting
This is rough example, but i think this works the way you want.
This is Construction Script in Cube actor
This is Level Blueprint.
After press "R", BP get all actors in a scene and try to change Color parameter in material. If actor have material with Color parameter, then color will changed.
answered Sep 17 '15 at 02:26 PM
In my product IwTransit, I do it this way.
This example is for changing the color, to alter other values, check the "type" that is needed in the material, and adjust as required, but the Name is absolutely required. I have not found a way to query a material, and get all the parameters it supports, and then get all the "types" that it is. Such that I could say, I want all parameters, and of those, which is the parameter for the color?
Don't forget to set the new Material Instance to the static mesh, skeleton, whatever. For primitive components, the node is Set Material.
Hope this helps.
answered Sep 17 '15 at 01:47 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here