Navigation
API > API/Plugins > API/Plugins/AvalancheFunctionalTest
Screenshot functional test optimized for Avalanche (Motion Design) levels.
This class works around two critical issues that prevent regular screenshot tests from working correctly in Avalanche/Motion Design levels:
CVar Priority Conflicts:
- Avalanche's custom viewport client (UAvaGameViewportClient) sets rendering CVars at Constructor/Code priority levels
- Base AScreenshotFunctionalTest uses SetWithCurrentPriority() which cannot override Constructor-level CVars, causing 12 CVars to fail with priority errors
- This class uses ECVF_SetByConsole priority to successfully override during test
PIE Screenshot Delegate Mismatch:
- PIE uses FEditorViewportClient::ProcessScreenShots() which fires the static FScreenshotRequest::OnScreenshotCaptured() delegate
- Base class only registers to the instance UGameViewportClient::OnScreenshotCaptured()
- This class registers to BOTH delegates to support PIE and standalone execution
Usage: Use this class instead of AScreenshotFunctionalTest when creating screenshot tests for Avalanche/Motion Design levels. It's only available when the Avalanche plugin is enabled.
Note: CVars are NOT restored after test completion to avoid priority stickiness issues. Test-friendly values (AA=0, ScreenPercentage=100, MotionBlur=0) remain in place.
| Name | AScreenshotFunctionalTestAvalanche |
| Type | class |
| Header File | /Engine/Plugins/VirtualProduction/Avalanche/Source/AvalancheFunctionalTest/Public/ScreenshotFunctionalTestAvalanche.h |
| Include Path | #include "ScreenshotFunctionalTestAvalanche.h" |
Syntax
UCLASS (Blueprintable, MinimalAPI, DisplayName="Screenshot Functional Test Motion Design")
class AScreenshotFunctionalTestAvalanche : public AScreenshotFunctionalTest
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → AActor → AFunctionalTest → AScreenshotFunctionalTestBase → AScreenshotFunctionalTest → AScreenshotFunctionalTestAvalanche
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
AScreenshotFunctionalTestAvalanche
(
const FObjectInitializer& ObjectInitializer |
ScreenshotFunctionalTestAvalanche.h |
Structs
| Name | Remarks |
|---|---|
| FScreenshotTestAvalancheCVarOverride | Helper struct to manage CVar overrides at Console priority. |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActorToWaitFor | TSoftObjectPtr< AActor > | The actor to wait for before taking the screenshot. | ScreenshotFunctionalTestAvalanche.h |
|
| bWaitForActorReady | bool | If enabled, the test will wait for the specified actor to be fully initialized before taking the screenshot, instead of relying on fixed time/frame delays. | ScreenshotFunctionalTestAvalanche.h |
|
| MaxActorWaitTime | float | Maximum time to wait for the actor to be ready (in seconds). | ScreenshotFunctionalTestAvalanche.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActorWaitStartTime | float | Time when PrepareTest() was called, used to enforce MaxActorWaitTime. | ScreenshotFunctionalTestAvalanche.h | |
| AntiAliasingOverride | FScreenshotTestAvalancheCVarOverride< int32 > | CVar overrides managed with explicit priority. | ScreenshotFunctionalTestAvalanche.h | |
| AutoExposureOverride | FScreenshotTestAvalancheCVarOverride< int32 > | ScreenshotFunctionalTestAvalanche.h | ||
| ContactShadowsOverride | FScreenshotTestAvalancheCVarOverride< int32 > | ScreenshotFunctionalTestAvalanche.h | ||
| DynamicResOperationModeOverride | FScreenshotTestAvalancheCVarOverride< int32 > | ScreenshotFunctionalTestAvalanche.h | ||
| DynamicResTestScreenPercentageOverride | FScreenshotTestAvalancheCVarOverride< int32 > | ScreenshotFunctionalTestAvalanche.h | ||
| EyeAdaptationQualityOverride | FScreenshotTestAvalancheCVarOverride< int32 > | ScreenshotFunctionalTestAvalanche.h | ||
| MotionBlurOverride | FScreenshotTestAvalancheCVarOverride< int32 > | ScreenshotFunctionalTestAvalanche.h | ||
| MotionBlurQualityOverride | FScreenshotTestAvalancheCVarOverride< int32 > | ScreenshotFunctionalTestAvalanche.h | ||
| RootedNiagaraSystems | TArray< TObjectPtr< UNiagaraSystem > > | NiagaraSystem assets temporarily rooted in FinishTest() to outlive async compilation tasks that may fire during test teardown. | ScreenshotFunctionalTestAvalanche.h | |
| ScreenPercentageOverride | FScreenshotTestAvalancheCVarOverride< float > | ScreenshotFunctionalTestAvalanche.h | ||
| ScreenSpaceReflectionQualityOverride | FScreenshotTestAvalancheCVarOverride< int32 > | ScreenshotFunctionalTestAvalanche.h | ||
| SecondaryScreenPercentageOverride | FScreenshotTestAvalancheCVarOverride< float > | ScreenshotFunctionalTestAvalanche.h | ||
| TonemapperGammaOverride | FScreenshotTestAvalancheCVarOverride< float > | ScreenshotFunctionalTestAvalanche.h |
Functions
Public
Protected Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
Override to unroot NiagaraSystem assets once the test actor is being destroyed. | ScreenshotFunctionalTestAvalanche.h |
Overridden from AScreenshotFunctionalTestBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| ScreenshotFunctionalTestAvalanche.h | |||
virtual void RequestScreenshot() |
Override to register to both instance and static screenshot delegates for PIE support. | ScreenshotFunctionalTestAvalanche.h |
Overridden from AFunctionalTest
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void FinishTest
(
EFunctionalTestResult TestResult, |
Override to root NiagaraSystem assets before test teardown, preventing GC from freeing them while async Niagara compilation tasks still hold TWeakObjectPtr refs. | ScreenshotFunctionalTestAvalanche.h | |
virtual bool IsReady_Implementation() |
Override to check if actor is ready before proceeding. | ScreenshotFunctionalTestAvalanche.h | |
virtual void PrepareTest() |
Override to set up CVars with explicit priority before base class setup. | ScreenshotFunctionalTestAvalanche.h |