LevelSequence.DefaultTickResolution
LevelSequence.DefaultTickResolution
#Overview
name: LevelSequence.DefaultTickResolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Specifies the default 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 11
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of LevelSequence.DefaultTickResolution is to specify the default tick resolution for newly created level sequences in Unreal Engine 5. This setting is primarily used in the animation and sequencing systems of the engine.
The Unreal Engine subsystems that rely on this setting variable are primarily the LevelSequence module and the MovieScene system. This can be seen from the file locations where the variable is referenced, such as LevelSequence.cpp and MovieSceneSequencePlayer.cpp.
The value of this variable is set in multiple places:
- It’s initially defined as a console variable with a default value of “24000fps”.
- It can be set through project settings in the ULevelSequenceProjectSettings class.
- It can be modified at runtime through the console variable system.
This variable interacts with several other variables, notably:
- CVarDefaultDisplayRate, which sets the default display frame rate.
- CVarDefaultLockEngineToDisplayRate, which determines if playback should be frame-locked.
- CVarDefaultClockSource, which specifies the default clock source for sequences.
Developers should be aware that:
- This variable affects the precision of sequence playback. A higher value (e.g., “24000fps”) allows for more precise timing but may have performance implications.
- The value can be overridden in project settings or through the console, so the actual value used may differ from the default.
- This setting only affects newly created sequences; existing sequences will retain their original tick resolution.
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 in project settings rather than relying on the default or changing it at runtime.
- Be aware of how this interacts with the display rate and other sequence settings.
Regarding the associated variable CVarDefaultTickResolution:
The purpose of CVarDefaultTickResolution is essentially the same as LevelSequence.DefaultTickResolution, but it’s specifically used in the context of Actor Sequences (a feature in Unreal Engine for creating in-actor animations).
This variable is used in the ActorSequence module, as seen in the ActorSequence.cpp file. It serves the same purpose as its LevelSequence counterpart but for a different type of sequence.
The value is set similarly, with a default of “24000fps”, and can be modified through the console variable system.
Developers should be aware that this variable specifically affects Actor Sequences, not Level Sequences. The same best practices apply: choose an appropriate resolution, maintain consistency, and be aware of its interactions with other sequence settings.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:68
Scope: file
Source code excerpt:
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"),
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.h:24
Scope (from outer to inner):
file
class class ULevelSequenceProjectSettings : public UDeveloperSettings
Source code excerpt:
FString DefaultDisplayRate;
UPROPERTY(config, EditAnywhere, Category=Timeline, meta=(ConsoleVariable="LevelSequence.DefaultTickResolution", Tooltip="Specifies default tick resolution for newly created level sequences. Examples: 30 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."))
FString DefaultTickResolution;
UPROPERTY(config, EditAnywhere, Category=Timeline, meta=(ConsoleVariable="LevelSequence.DefaultClockSource", Tooltip="Specifies default clock source for newly created level sequences. Examples: 0: Tick, 1: Platform, 2: Audio, 3: RelativeTimecode, 4: Timecode, 5: Custom"))
EUpdateClockSource DefaultClockSource;
virtual void PostInitProperties() override;
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:32
Scope (from outer to inner):
file
function void ULevelSequenceProjectSettings::PostInitProperties
Source code excerpt:
}
if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultTickResolution")))
{
ConsoleVariable->Set(*DefaultTickResolution, ECVF_SetByProjectSetting);
}
if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.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>();
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:9
Scope (from outer to inner):
file
function ULevelSequenceProjectSettings::ULevelSequenceProjectSettings
Source code excerpt:
: bDefaultLockEngineToDisplayRate(false)
, DefaultDisplayRate("30fps")
, DefaultTickResolution("24000fps")
, DefaultClockSource(EUpdateClockSource::Tick)
{ }
void ULevelSequenceProjectSettings::PostInitProperties()
{
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:34
Scope (from outer to inner):
file
function void ULevelSequenceProjectSettings::PostInitProperties
Source code excerpt:
if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultTickResolution")))
{
ConsoleVariable->Set(*DefaultTickResolution, ECVF_SetByProjectSetting);
}
if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultDisplayRate")))
{
ConsoleVariable->Set(*DefaultDisplayRate, ECVF_SetByProjectSetting);
}
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.h:25
Scope (from outer to inner):
file
class class ULevelSequenceProjectSettings : public UDeveloperSettings
Source code excerpt:
UPROPERTY(config, EditAnywhere, Category=Timeline, meta=(ConsoleVariable="LevelSequence.DefaultTickResolution", Tooltip="Specifies default tick resolution for newly created level sequences. Examples: 30 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."))
FString DefaultTickResolution;
UPROPERTY(config, EditAnywhere, Category=Timeline, meta=(ConsoleVariable="LevelSequence.DefaultClockSource", Tooltip="Specifies default clock source for newly created level sequences. Examples: 0: Tick, 1: Platform, 2: Audio, 3: RelativeTimecode, 4: Timecode, 5: Custom"))
EUpdateClockSource DefaultClockSource;
virtual void PostInitProperties() override;
#if WITH_EDITOR
#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneSequencePlayer.cpp:911
Scope (from outer to inner):
file
function void UMovieSceneSequencePlayer::Initialize
Source code excerpt:
{
const FString SequenceName = GetSequenceName(true);
const FFrameRate DefaultTickResolution(60000, 1);
UE_LOG(LogMovieScene, Error, TEXT("Attempting to set sequence %s with an invalid tick resolution: %s, defaulting to: %s"), *SequenceName, *TickResolution.ToPrettyText().ToString(), *DefaultTickResolution.ToPrettyText().ToString());
TickResolution = DefaultTickResolution;
}
if (!DisplayRate.IsValid() || DisplayRate.Numerator <= 0)
{
const FString SequenceName = GetSequenceName(true);
const FFrameRate DefaultDisplayRate(30, 1);