ActorSequence.DefaultDisplayRate
ActorSequence.DefaultDisplayRate
#Overview
name: ActorSequence.DefaultDisplayRate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
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).
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ActorSequence.DefaultDisplayRate is to specify the default display frame rate for newly created actor sequences in Unreal Engine 5. This setting is primarily used in the animation and sequencing system of the engine.
This setting variable is relied upon by the ActorSequence plugin, which is part of the MovieScene module in Unreal Engine 5. It’s specifically used in the initialization of UActorSequence objects.
The value of this variable is set as a console variable (CVar) with a default value of “30fps”. It can be changed at runtime through console commands or configuration files.
The associated variable CVarDefaultDisplayRate interacts directly with ActorSequence.DefaultDisplayRate. They share the same value and purpose.
Developers should be aware that:
- This variable affects the default display rate of newly created actor 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).
- This setting also defines the frame-locked frame rate for sequences set to be frame-locked.
Best practices when using this variable include:
- Consider the target platform and performance requirements when setting this value.
- Ensure consistency across your project by setting this value in a project-wide configuration file.
- Be aware that changing this value will only affect newly created sequences, not existing ones.
Regarding the associated variable CVarDefaultDisplayRate:
- Its purpose is identical to ActorSequence.DefaultDisplayRate, but it’s the actual C++ variable used in the code.
- It’s used in both the ActorSequence and LevelSequence modules.
- The value is retrieved using GetValueOnGameThread() when initializing new sequences.
- Developers should be aware that changes to this CVar will affect both actor sequences and level sequences.
- Best practices include using this variable consistently across different sequence types in your project for uniformity.
#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:33
Scope: file
Source code excerpt:
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)
#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
}