AutomationScreenshotResolutionHeight
AutomationScreenshotResolutionHeight
#Overview
name: AutomationScreenshotResolutionHeight
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The height of automation screenshots.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of AutomationScreenshotResolutionHeight is to set the height of automation screenshots in Unreal Engine 5. This setting variable is used in the context of automated testing and screenshot capture functionality.
The Unreal Engine subsystem that relies on this setting variable is the Functional Testing module, specifically within the automation and screenshot capture features. This can be seen from the file path Engine/Source/Developer/FunctionalTesting/Private/AutomationBlueprintFunctionLibrary.cpp
.
The value of this variable is set through a console variable (CVar) system. It is defined as a TAutoConsoleVariable with an initial value of 0, which means it can be changed at runtime through console commands or configuration files.
This variable interacts with another variable called CVarAutomationScreenshotResolutionWidth, which sets the width of automation screenshots. Together, these variables determine the resolution of automated screenshots.
Developers must be aware that:
- The default value is 0, which means no override is applied unless explicitly set.
- This variable is used in conjunction with CVarAutomationScreenshotResolutionWidth to determine the final screenshot size.
- The value is retrieved using the GetValueOnGameThread() method, indicating it’s designed for use in the game thread.
Best practices when using this variable include:
- Set both height and width variables to maintain the desired aspect ratio.
- Consider performance implications when setting very high resolutions for automated screenshots.
- Ensure the values set are appropriate for the testing environment and target platforms.
Regarding the associated variable CVarAutomationScreenshotResolutionHeight:
The purpose of CVarAutomationScreenshotResolutionHeight is to provide a console-variable interface for the AutomationScreenshotResolutionHeight setting. It allows for runtime modification of the screenshot height value.
This variable is defined in the same Functional Testing module and is used directly in the GetAutomationScreenshotSize function of the UAutomationBlueprintFunctionLibrary class.
The value of this variable is set when it’s defined, with an initial value of 0, but can be changed through console commands or configuration files at runtime.
CVarAutomationScreenshotResolutionHeight interacts directly with the AutomationScreenshotResolutionHeight setting, effectively serving as its runtime-accessible counterpart.
Developers should be aware that:
- This variable provides a way to override the default screenshot height at runtime.
- A value of 0 or less means no override will be applied.
Best practices for using this variable include:
- Use it in conjunction with CVarAutomationScreenshotResolutionWidth to maintain aspect ratio.
- Consider using this for dynamic adjustments during testing or to adapt to different testing environments without recompiling.
- Document any custom values used in automated tests to ensure reproducibility.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/FunctionalTesting/Private/AutomationBlueprintFunctionLibrary.cpp:73
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarAutomationScreenshotResolutionHeight(
TEXT("AutomationScreenshotResolutionHeight"),
0,
TEXT("The height of automation screenshots."),
ECVF_Default);
bool UAutomationEditorTask::IsValidTask() const
#Associated Variable and Callsites
This variable is associated with another variable named CVarAutomationScreenshotResolutionHeight
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Developer/FunctionalTesting/Private/AutomationBlueprintFunctionLibrary.cpp:72
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<int32> CVarAutomationScreenshotResolutionHeight(
TEXT("AutomationScreenshotResolutionHeight"),
0,
TEXT("The height of automation screenshots."),
ECVF_Default);
#Loc: <Workspace>/Engine/Source/Developer/FunctionalTesting/Private/AutomationBlueprintFunctionLibrary.cpp:761
Scope (from outer to inner):
file
function FIntPoint UAutomationBlueprintFunctionLibrary::GetAutomationScreenshotSize
Source code excerpt:
// device profiles setup, to configure the CVars for controlling the automation screenshot size.
int32 OverrideWidth = CVarAutomationScreenshotResolutionWidth.GetValueOnGameThread();
int32 OverrideHeight = CVarAutomationScreenshotResolutionHeight.GetValueOnGameThread();
if (OverrideWidth > 0)
{
ResolutionX = (uint32)OverrideWidth;
}