Post Process Material Toggle in UMG

Hi all,

Just wondering, is there any way I can toggle a post process material with a keyboard input? I’ve got a highlight material at the moment and I’d like to be able to turn it off and back on again with keyboard input.

Thanks in advance.

1 Like

If you create an actor with a post process volume as a component, you can get a reference to that actor, get the post process volume, and just alter the material from there.

So after making the blueprint Actor, adding a post-processing volume in and applying that material to the post process volume, I referenced the actor into the Level blueprint to then kind the key to toggle but I’m not sure what nodes to use to tell it to toggle. Do I just use a flip/flop node?

Thanks for that. Issue I’m having is connecting the Post Process target to the settings bit. I can’t seem to make it auto convert from target to ref?

A flip/flop would work if you only need to toggle with 2 materials.

I would create a function inside the Actor holding the PostProcess volume like this:

Then you could just call that function from wherever :slight_smile:

sorry, could you show an image? i didn’t get which part =O

For clarity I renamed the post process component to “PostProcessComponent”

262955-0.png

Which is what i was getting Settings from in the first place. if you want to get it from the PostProcess Actor we created, you would need to get it’s post process component first, and from that you can get its settings :slight_smile:

This part. I can’t connect to the Struct Ref

262949-capture.png

I’ve renamed it to Component and I still can’t connect it. I’ve tried to drag the component to the “Struct Ref” and it doesn’t work. I’ve tried to drag from the component and it still doesn’t work. It just seems to refuse it. When I drag out from the Struct Ref and try “get post process component” it doesn’t accept it either. IT just creates it and doesn’t connect it. What am I doing wrong because this is meant to the easy bit…

262962-connectissue.gif

this isn’t showing?

262968-like-this.gif

Got it, just wouldn’t show for some reason so I drew out from the Set members node. So now this is done, how do I call this event?

yeah, an actor blueprint, with a post process added as a component. you should be able to get the post process settings off of it.

We’re both on 4.21, so it should work the same.

first you place the object in the world in the editor, and you can treat its post process component like a normal post process volume now. (remember to mark it unbound).

A get all actors of class and get index 0 will get it, as it will be only 1 of these in the level.

262969-0.png

If you’re going to toggle it several times, you could get the actor on begin play and store it as a reference for later use. (So you don’t have to do a massive search each time you need it)

Spot on. Got it to work perfectly! Thank you so so much for all the help! :slight_smile:

Hopefully this helps someone. :slight_smile:

1 Like