UMG.AnimationMarkers
UMG.AnimationMarkers
#Overview
name: UMG.AnimationMarkers
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
(Default: false) Whether to emit profiling frame markers for starting and stopping UMG animations.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of UMG.AnimationMarkers is to control the emission of profiling frame markers for starting and stopping UMG animations. This setting variable is primarily used for debugging and performance analysis of UMG (Unreal Motion Graphics) animations.
This setting variable is utilized within the UMG module of Unreal Engine, specifically in the animation system for UMG widgets. Based on the callsites, it’s evident that this variable is used in the UUMGSequencePlayer class, which is responsible for playing UMG animations.
The value of this variable is set through a console variable (cvar) system. It’s initialized as false by default, but can be changed at runtime through the console or configuration files.
The associated variable GVarAnimationMarkers directly interacts with UMG.AnimationMarkers. They share the same value, with GVarAnimationMarkers being the actual boolean variable used in the code to check the setting’s state.
Developers should be aware that enabling this variable will impact performance due to the additional overhead of emitting profiling markers. It should primarily be used during development and debugging phases, not in production builds.
Best practices for using this variable include:
- Enable it only when specifically investigating UMG animation performance issues.
- Remember to disable it after debugging to avoid unnecessary performance overhead.
- Use it in conjunction with Unreal Engine’s profiling tools to get a comprehensive view of animation performance.
Regarding the associated variable GVarAnimationMarkers:
The purpose of GVarAnimationMarkers is to serve as the actual boolean flag checked in the code to determine whether animation markers should be emitted.
It’s used within the UMG module, specifically in the UUMGSequencePlayer class for controlling the emission of CSV events for animation start and stop.
The value of GVarAnimationMarkers is set through the console variable system, mirroring the value of UMG.AnimationMarkers.
It directly interacts with UMG.AnimationMarkers, essentially serving as its in-code representation.
Developers should be aware that checking this variable adds a small overhead to animation playback and should be used judiciously.
Best practices for GVarAnimationMarkers align with those of UMG.AnimationMarkers, as they are effectively the same setting represented in different ways within the engine.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/UMG/Private/Animation/UMGSequencePlayer.cpp:27
Scope (from outer to inner):
file
namespace UE::UMG
Source code excerpt:
bool GVarAnimationMarkers = false;
FAutoConsoleVariableRef CVarAnimationMarkers(
TEXT("UMG.AnimationMarkers"),
GVarAnimationMarkers,
TEXT("(Default: false) Whether to emit profiling frame markers for starting and stopping UMG animations.")
);
} // namespace UE::UMG
#Associated Variable and Callsites
This variable is associated with another variable named GVarAnimationMarkers
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/UMG/Private/Animation/UMGSequencePlayer.cpp:25
Scope (from outer to inner):
file
namespace UE::UMG
Source code excerpt:
);
bool GVarAnimationMarkers = false;
FAutoConsoleVariableRef CVarAnimationMarkers(
TEXT("UMG.AnimationMarkers"),
GVarAnimationMarkers,
TEXT("(Default: false) Whether to emit profiling frame markers for starting and stopping UMG animations.")
);
} // namespace UE::UMG
UUMGSequencePlayer::UUMGSequencePlayer(const FObjectInitializer& ObjectInitializer)
#Loc: <Workspace>/Engine/Source/Runtime/UMG/Private/Animation/UMGSequencePlayer.cpp:229
Scope (from outer to inner):
file
function void UUMGSequencePlayer::PlayInternal
Source code excerpt:
UUMGSequenceTickManager* TickManager = Widget ? ToRawPtr(Widget->AnimationTickManager) : nullptr;
if (UE::UMG::GVarAnimationMarkers && Animation && Widget)
{
CSV_EVENT_GLOBAL(TEXT("Play Animation [%s::%s]"), *Widget->GetName(), *Animation->GetName());
}
TSharedPtr<FMovieSceneEntitySystemRunner> RunnerToUse = TickManager ? TickManager->GetRunner() : nullptr;
if (EnumHasAnyFlags(Animation->GetFlags(), EMovieSceneSequenceFlags::BlockingEvaluation))
#Loc: <Workspace>/Engine/Source/Runtime/UMG/Private/Animation/UMGSequencePlayer.cpp:448
Scope (from outer to inner):
file
function void UUMGSequencePlayer::HandleLatentStop
Source code excerpt:
if (Widget)
{
if (UE::UMG::GVarAnimationMarkers && Animation)
{
CSV_EVENT_GLOBAL(TEXT("Stop Animation [%s::%s]"), *Widget->GetName(), *Animation->GetName());
}
Widget->OnAnimationFinishedPlaying(*this);
}