LevelSequence.DefaultDisplayRate
LevelSequence.DefaultDisplayRate
#Overview
name: LevelSequence.DefaultDisplayRate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
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).
It is referenced in 11
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of LevelSequence.DefaultDisplayRate is to specify the default display frame rate for newly created level sequences in Unreal Engine 5. It also defines the frame-locked frame rate for sequences that are set to be frame-locked.
This setting variable is primarily used in the LevelSequence module, which is part of Unreal Engine’s cinematics and sequencer system. It affects how level sequences are initialized and displayed.
The value of this variable is set in multiple places:
- As a console variable with a default value of “30fps”.
- In the ULevelSequenceProjectSettings class, where it can be configured in the project settings.
- It can be overridden at runtime through the console.
This variable interacts closely with other related variables, such as DefaultTickResolution and DefaultClockSource. Together, these variables define the timing behavior of level sequences.
Developers should be aware that:
- This variable affects newly created level sequences, not existing ones.
- 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).
- Changing this value will affect the visual playback rate of sequences, but not necessarily the internal tick resolution.
Best practices when using this variable include:
- Setting it to a value that matches your project’s target frame rate or the frame rate of your video output.
- Ensuring consistency between this value and related variables like DefaultTickResolution.
- Documenting any custom values used in your project to maintain consistency across the development team.
Regarding the associated variable CVarDefaultDisplayRate:
The purpose of CVarDefaultDisplayRate is essentially the same as LevelSequence.DefaultDisplayRate, but it’s specifically used in the ActorSequence plugin. It serves as a console variable that can be used to set or retrieve the default display rate for actor sequences.
This variable is used in the ActorSequence module, which is a plugin that allows for sequence-based animation of individual actors.
The value is set as a console variable with a default of “30fps”, similar to LevelSequence.DefaultDisplayRate.
It interacts with other variables in the ActorSequence module, such as CVarDefaultTickResolution.
Developers should be aware that this variable specifically affects actor sequences, which are a different type of sequence from level sequences.
Best practices for using CVarDefaultDisplayRate are similar to those for LevelSequence.DefaultDisplayRate, but with a focus on actor-specific sequences rather than level-wide sequences.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:74
Scope: file
Source code excerpt:
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);
static TAutoConsoleVariable<int32> CVarDefaultClockSource(
TEXT("LevelSequence.DefaultClockSource"),
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.h:21
Scope (from outer to inner):
file
class class ULevelSequenceProjectSettings : public UDeveloperSettings
Source code excerpt:
bool bDefaultLockEngineToDisplayRate;
UPROPERTY(config, EditAnywhere, Category=Timeline, meta=(ConsoleVariable="LevelSequence.DefaultDisplayRate", Tooltip="Specifies 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)."))
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"))
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:37
Scope (from outer to inner):
file
function void ULevelSequenceProjectSettings::PostInitProperties
Source code excerpt:
}
if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultDisplayRate")))
{
ConsoleVariable->Set(*DefaultDisplayRate, ECVF_SetByProjectSetting);
}
if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultClockSource")))
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarDefaultDisplayRate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/MovieScene/ActorSequence/Source/ActorSequence/Private/ActorSequence.cpp:29
Scope: file
Source code excerpt:
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);
UActorSequence::UActorSequence(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, MovieScene(nullptr)
#if WITH_EDITORONLY_DATA
, bHasBeenInitialized(false)
#endif
#Loc: <Workspace>/Engine/Plugins/MovieScene/ActorSequence/Source/ActorSequence/Private/ActorSequence.cpp:95
Scope (from outer to inner):
file
function void UActorSequence::PostInitProperties
Source code excerpt:
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
Super::PostInitProperties();
}
void UActorSequence::BindPossessableObject(const FGuid& ObjectId, UObject& PossessedObject, UObject* Context)
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:70
Scope: file
Source code excerpt:
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);
static TAutoConsoleVariable<int32> CVarDefaultClockSource(
TEXT("LevelSequence.DefaultClockSource"),
0,
TEXT("Specifies the default clock source for newly created level sequences. 0: Tick, 1: Platform, 2: Audio, 3: RelativeTimecode, 4: Timecode, 5: Custom"),
ECVF_Default);
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:102
Scope (from outer to inner):
file
function void ULevelSequence::Initialize
Source code excerpt:
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>();
MetaData->SetCreated(FDateTime::UtcNow());
MetaData->SetAuthor(FApp::GetSessionOwner());
#endif
}
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:8
Scope (from outer to inner):
file
function ULevelSequenceProjectSettings::ULevelSequenceProjectSettings
Source code excerpt:
ULevelSequenceProjectSettings::ULevelSequenceProjectSettings()
: bDefaultLockEngineToDisplayRate(false)
, DefaultDisplayRate("30fps")
, DefaultTickResolution("24000fps")
, DefaultClockSource(EUpdateClockSource::Tick)
{ }
void ULevelSequenceProjectSettings::PostInitProperties()
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:39
Scope (from outer to inner):
file
function void ULevelSequenceProjectSettings::PostInitProperties
Source code excerpt:
if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultDisplayRate")))
{
ConsoleVariable->Set(*DefaultDisplayRate, ECVF_SetByProjectSetting);
}
if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultClockSource")))
{
ConsoleVariable->Set((int32)DefaultClockSource, ECVF_SetByProjectSetting);
}
#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.h:22
Scope (from outer to inner):
file
class class ULevelSequenceProjectSettings : public UDeveloperSettings
Source code excerpt:
UPROPERTY(config, EditAnywhere, Category=Timeline, meta=(ConsoleVariable="LevelSequence.DefaultDisplayRate", Tooltip="Specifies 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)."))
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;
#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneSequencePlayer.cpp:919
Scope (from outer to inner):
file
function void UMovieSceneSequencePlayer::Initialize
Source code excerpt:
{
const FString SequenceName = GetSequenceName(true);
const FFrameRate DefaultDisplayRate(30, 1);
UE_LOG(LogMovieScene, Error, TEXT("Attempting to set sequence %s with an invalid display rate: %s, defaulting to: %s"), *SequenceName, *DisplayRate.ToPrettyText().ToString(), *DefaultDisplayRate.ToPrettyText().ToString());
DisplayRate = DefaultDisplayRate;
}
// We set the play position in terms of the display rate,
// but want evaluation ranges in the moviescene's tick resolution
PlayPosition.SetTimeBase(DisplayRate, TickResolution, EvaluationType);