Reset value variable set by console command / Read default scalability settings from C++
Hello to everyone,
I'm working on a settings menu where I change the post process quality using a button. I also have some checkboxes to enable / disable some graphics settings on top the scalability settings. So you can set, for example, the post process quality to 3 and it applies the scalability quality 3, but you can maybe want to disable motion blur on top of that.
The problem I found is that if I change one specific value, let's say motion blur (r.MotionBlurQuality), it works fine but when I change again the scalability settings the motion blur value doesn't change. Reading the documentation here it seems that the console value is the last one applied. I'm changing the values from C++ using APlayerController->ConsoleCommand.
Is there any way to reset the value set by the console? If is not possible, how can I read all the values for each scalability setting from C++ and apply them manually?
Thanks in advance.
asked Apr 21 '16 at 10:03 AM in Using UE4
Ok, I found a way to change it. This is how the order is applied to the console settings:
What I was doing was using UWorld::Exec / APlayerController->ConsoleCommand, and they both use flag SetByConsole, so when I changed the Scalability settings it used the flag SetByScalability, so the specific settings I changed manually were not updated because of the priority.
What I ended doing was setting the value manually using the flag SetByGameSetting. Here the example for MotionBlur:
// That sets specifically the motion blur static auto CVar = IConsoleManager::Get().FindConsoleVariable("r.MotionBlurQuality"); CVar->Set(value, ECVF_SetByGameSetting);
If instead of r.MotionBlurQuality you use sg.PostProcessQuality you change all the settings (including motion blur).
I hope this could help to someone.
answered Apr 22 '16 at 09:26 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here