How to add a psotprocessing shader to a camera component from code

I have a tuned Post processing material which can be added to Post Processing Misc Blendables from and Editor.

How can I add and remove it to a Character’s follow camera at runtime on a Key press?

I want to make a switchable NghtVision effect on a key press.

It was as easy as

Camera->PostProcessSettings.Blendables.Add(NightVisionMaterial);

and

Camera->PostProcessSettings.Blendables.Remove(NightVisionMaterial);

In 4.9 API have changed, the add string will look

Camera->PostProcessSettings.WeightedBlendables.Array.Add(FWeightedBlendable(1.0f, NightVisionMaterial));

Do you know how to do it to a PlayerCameraManager?

Sory, Ruzihm, never worked with PlayerCameraManager. Do not know what it is for.

But from doc, it looks like you can manage some PostProcessingSettings using AddCachedPPBlend, ClearCachedPPBlends and GetCachedPostProcessBlends functions. They have FPostProcessSettings objects, which should be worked the same way as I do.

But I don’t know the concept of PlayerCameraManager and how it relates to camera. So I am not 100% sure.

Wow, thanks for the quick reply!

Yeah, I saw those but did not have much luck. I may need to post a separate question for my problem. Thanks again.