How to control AutoExposure via C++?

I’m not that good at programming so please bear with me. I’m having issues with the AutoExposure making my scene too bright. I can turn it off in the Project Settings but I would like to know how to control it in C++ instead of disabling it. I’ve been messing around with FPostProcessSettings and FCameraExposureSettings but I can’t seem to figure out how they work. It either doesn’t do anything or it doesn’t compile. The documentation isn’t helping me. If I go to the definition, I can see that it’s a struct which is apparently disabled by default. Can I get a quick example with these structs? As embarrassing as this is, I have clearly not fully grasped how to use structs yet.

I try a method.
1.Create a c++ character ,and add a camera component attach to rootcomponent.
2.Create a Blueprint with c++ character.Modify Character Blueprint/camera component/Lens/AutoExposeure/[MinBrightness is 0 and MaxBrightness is 10].
3.Add “camera->PostProcessSettings.bOverride_AutoExposureMinBrightness = true;camera->PostProcessSettings.bOverride_AutoExposureMaxBrightness = true;camera->PostProcessSettings.bOverride_AutoExposureMethod = true;” In BeginPlay Function.
4.Add A BlueprintFunction(BlueprintCallable),this function implement switch AutoExposureMethod,Such as “void AMyCharacter::SwitchExposure(bool b){b ? camera->PostProcessSettings.AutoExposureMethod = EAutoExposureMethod::AEM_Histogram:camera->PostProcessSettings.AutoExposureMethod = ![alt text][1]EAutoExposureMethod::AEM_Basic;}”
5.In Blueprint Character ,Call c++ “SwitchExposure” function.Screen has Darkening.

1 Like