ActorSequence.DefaultTickResolution
ActorSequence.DefaultTickResolution
#Overview
name: ActorSequence.DefaultTickResolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Specifies default a tick resolution for newly created level sequences. Examples: 30 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms).
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ActorSequence.DefaultTickResolution is to specify the default tick resolution for newly created actor sequences in Unreal Engine 5. This setting is primarily used in the animation and sequencing system of the engine.
Based on the callsites, this setting variable is utilized in the ActorSequence plugin, which is part of the MovieScene module in Unreal Engine 5. It’s also used in the LevelSequence module, indicating its importance in both actor-specific and level-wide sequencing.
The value of this variable is set as a console variable (CVar) with a default value of “24000fps”. It can be modified through the console or configuration files.
This variable interacts closely with CVarDefaultDisplayRate and CVarDefaultEvaluationType. Together, these variables define the timing and evaluation behavior of sequences.
Developers should be aware that:
- This setting affects the precision of timing in sequences. A higher tick resolution allows for more precise timing but may increase memory usage.
- The value can be specified in various formats, such as “30 fps”, “120/1” (120 fps), “30000/1001” (29.97 fps), or “0.01s” (10ms).
- This setting is applied when initializing new sequences, not existing ones.
Best practices when using this variable include:
- Choose a tick resolution that balances precision needs with performance considerations.
- Ensure consistency across your project by setting this at the project level rather than adjusting it frequently.
- Consider the relationship between tick resolution and display rate when setting up your sequences.
Regarding the associated variable CVarDefaultTickResolution:
The purpose of CVarDefaultTickResolution is to store and provide access to the ActorSequence.DefaultTickResolution value within the C++ code.
This variable is used in both the ActorSequence and LevelSequence modules, indicating its importance across different types of sequences in Unreal Engine.
The value is set when the engine initializes the console variables, and it’s accessed during the initialization of new sequences.
It interacts directly with the MovieScene object, setting its tick resolution via the SetTickResolutionDirectly method.
Developers should be aware that:
- This variable is read at runtime, allowing for dynamic changes to the default tick resolution.
- It affects newly created sequences, not existing ones.
Best practices include:
- Use this variable to read the current default tick resolution rather than hardcoding values.
- When creating custom sequencing systems, consider following this pattern of using console variables for default values to maintain consistency with the engine’s approach.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/MovieScene/ActorSequence/Source/ActorSequence/Private/ActorSequence.cpp:27
Scope: file
Source code excerpt:
static TAutoConsoleVariable<FString> CVarDefaultTickResolution(
TEXT("ActorSequence.DefaultTickResolution"),
TEXT("24000fps"),
TEXT("Specifies default a tick resolution for newly created level sequences. Examples: 30 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."),
ECVF_Default);
static TAutoConsoleVariable<FString> CVarDefaultDisplayRate(
TEXT("ActorSequence.DefaultDisplayRate"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarDefaultTickResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/MovieScene/ActorSequence/Source/ActorSequence/Private/ActorSequence.cpp:23
Scope: file
Source code excerpt:
TEXT("ActorSequence.DefaultEvaluationType"),
0,
TEXT("0: Playback locked to playback frames\n1: Unlocked playback with sub frame interpolation"),
ECVF_Default);
static TAutoConsoleVariable<FString> CVarDefaultTickResolution(
TEXT("ActorSequence.DefaultTickResolution"),
TEXT("24000fps"),
TEXT("Specifies default a tick resolution for newly created level sequences. Examples: 30 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."),
ECVF_Default);
static TAutoConsoleVariable<FString> CVarDefaultDisplayRate(
TEXT("ActorSequence.DefaultDisplayRate"),
TEXT("30fps"),
TEXT("Specifies default a display frame rate for newly created level sequences; also defines frame locked frame rate where sequences are set to be frame locked. Examples: 30 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."),
ECVF_Default);
#Loc: <Workspace>/Engine/Plugins/MovieScene/ActorSequence/Source/ActorSequence/Private/ActorSequence.cpp:91
Scope (from outer to inner):
file
function void UActorSequence::PostInitProperties
Source code excerpt:
const bool bFrameLocked = CVarDefaultEvaluationType.GetValueOnGameThread() != 0;
MovieScene->SetEvaluationType( bFrameLocked ? EMovieSceneEvaluationType::FrameLocked : EMovieSceneEvaluationType::WithSubFrames );
FFrameRate TickResolution(60000, 1);
TryParseString(TickResolution, *CVarDefaultTickResolution.GetValueOnGameThread());
MovieScene->SetTickResolutionDirectly(TickResolution);
FFrameRate DisplayRate(30, 1);
TryParseString(DisplayRate, *CVarDefaultDisplayRate.GetValueOnGameThread());
MovieScene->SetDisplayRate(DisplayRate);
OnInitializeSequenceEvent.Broadcast(this);
bHasBeenInitialized = true;
}
#endif
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:64
Scope: file
Source code excerpt:
TEXT("LevelSequence.DefaultLockEngineToDisplayRate"),
0,
TEXT("0: Playback locked to playback frames\n1: Unlocked playback with sub frame interpolation"),
ECVF_Default);
static TAutoConsoleVariable<FString> CVarDefaultTickResolution(
TEXT("LevelSequence.DefaultTickResolution"),
TEXT("24000fps"),
TEXT("Specifies the default tick resolution for newly created level sequences. Examples: 30 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."),
ECVF_Default);
static TAutoConsoleVariable<FString> CVarDefaultDisplayRate(
TEXT("LevelSequence.DefaultDisplayRate"),
TEXT("30fps"),
TEXT("Specifies the default display frame rate for newly created level sequences; also defines frame locked frame rate where sequences are set to be frame locked. Examples: 30 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."),
ECVF_Default);
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:98
Scope (from outer to inner):
file
function void ULevelSequence::Initialize
Source code excerpt:
const bool bFrameLocked = CVarDefaultLockEngineToDisplayRate.GetValueOnGameThread() != 0;
MovieScene->SetEvaluationType( bFrameLocked ? EMovieSceneEvaluationType::FrameLocked : EMovieSceneEvaluationType::WithSubFrames );
FFrameRate TickResolution(60000, 1);
TryParseString(TickResolution, *CVarDefaultTickResolution.GetValueOnGameThread());
MovieScene->SetTickResolutionDirectly(TickResolution);
FFrameRate DisplayRate(30, 1);
TryParseString(DisplayRate, *CVarDefaultDisplayRate.GetValueOnGameThread());
MovieScene->SetDisplayRate(DisplayRate);
int32 ClockSource = CVarDefaultClockSource.GetValueOnGameThread();
MovieScene->SetClockSource((EUpdateClockSource)ClockSource);
#if WITH_EDITOR
UMovieSceneMetaData* MetaData = FindOrAddMetaData<UMovieSceneMetaData>();