LevelSequence.DefaultLockEngineToDisplayRate

LevelSequence.DefaultLockEngineToDisplayRate

#Overview

name: LevelSequence.DefaultLockEngineToDisplayRate

This variable is created as a Console Variable (cvar).

It is referenced in 8 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of LevelSequence.DefaultLockEngineToDisplayRate is to control the playback behavior of level sequences in Unreal Engine 5. It determines whether the playback is locked to playback frames or uses unlocked playback with sub-frame interpolation.

This setting variable is primarily used by the LevelSequence module, which is part of Unreal Engine’s cinematics and sequencer system. It affects how level sequences are initialized and played back.

The value of this variable is set in multiple places:

  1. As a console variable (CVarDefaultLockEngineToDisplayRate) with a default value of 0.
  2. In the ULevelSequenceProjectSettings class as a configurable property (bDefaultLockEngineToDisplayRate).
  3. It can be modified through project settings or console commands.

The associated variable CVarDefaultLockEngineToDisplayRate interacts directly with LevelSequence.DefaultLockEngineToDisplayRate. They share the same value and purpose.

Developers should be aware that:

  1. This setting affects all newly created level sequences.
  2. Changing this value can impact the smoothness and accuracy of sequence playback.
  3. It has implications for performance and visual fidelity.

Best practices when using this variable include:

  1. Consider the target platform and performance requirements when choosing the setting.
  2. Use frame-locked playback (value 0) for precise frame-by-frame control.
  3. Use unlocked playback with sub-frame interpolation (value 1) for smoother motion, especially at higher frame rates.
  4. Ensure consistency across the project by setting this value in the project settings rather than modifying it at runtime.

Regarding the associated variable CVarDefaultLockEngineToDisplayRate:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:62

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarDefaultLockEngineToDisplayRate(
	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"),

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.h:18

Scope (from outer to inner):

file
class        class ULevelSequenceProjectSettings : public UDeveloperSettings

Source code excerpt:

	ULevelSequenceProjectSettings();

	UPROPERTY(config, EditAnywhere, Category=Timeline, meta=(ConsoleVariable="LevelSequence.DefaultLockEngineToDisplayRate", Tooltip="0: Playback locked to playback frames\n1: Unlocked playback with sub frame interpolation"))
	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)."))

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:27

Scope (from outer to inner):

file
function     void ULevelSequenceProjectSettings::PostInitProperties

Source code excerpt:

		// ImportConsoleVariableValues();
	
		if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultLockEngineToDisplayRate")))
		{
			ConsoleVariable->Set((int32)bDefaultLockEngineToDisplayRate, ECVF_SetByProjectSetting);
		}

		if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultTickResolution")))
		{

#Associated Variable and Callsites

This variable is associated with another variable named CVarDefaultLockEngineToDisplayRate. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:61

Scope: file

Source code excerpt:

#endif

static TAutoConsoleVariable<int32> CVarDefaultLockEngineToDisplayRate(
	TEXT("LevelSequence.DefaultLockEngineToDisplayRate"),
	0,
	TEXT("0: Playback locked to playback frames\n1: Unlocked playback with sub frame interpolation"),
	ECVF_Default);

static TAutoConsoleVariable<FString> CVarDefaultTickResolution(

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequence.cpp:96

Scope (from outer to inner):

file
function     void ULevelSequence::Initialize

Source code excerpt:

	MovieScene = NewObject<UMovieScene>(this, NAME_None, RF_Transactional);

	const bool bFrameLocked = CVarDefaultLockEngineToDisplayRate.GetValueOnGameThread() != 0;

	MovieScene->SetEvaluationType( bFrameLocked ? EMovieSceneEvaluationType::FrameLocked : EMovieSceneEvaluationType::WithSubFrames );

	FFrameRate TickResolution(60000, 1);
	TryParseString(TickResolution, *CVarDefaultTickResolution.GetValueOnGameThread());
	MovieScene->SetTickResolutionDirectly(TickResolution);

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:7

Scope (from outer to inner):

file
function     ULevelSequenceProjectSettings::ULevelSequenceProjectSettings

Source code excerpt:


ULevelSequenceProjectSettings::ULevelSequenceProjectSettings()
	: bDefaultLockEngineToDisplayRate(false)
	, DefaultDisplayRate("30fps")
	, DefaultTickResolution("24000fps")
	, DefaultClockSource(EUpdateClockSource::Tick)
{ }

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.cpp:29

Scope (from outer to inner):

file
function     void ULevelSequenceProjectSettings::PostInitProperties

Source code excerpt:

		if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultLockEngineToDisplayRate")))
		{
			ConsoleVariable->Set((int32)bDefaultLockEngineToDisplayRate, ECVF_SetByProjectSetting);
		}

		if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("LevelSequence.DefaultTickResolution")))
		{
			ConsoleVariable->Set(*DefaultTickResolution, ECVF_SetByProjectSetting);
		}

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceProjectSettings.h:19

Scope (from outer to inner):

file
class        class ULevelSequenceProjectSettings : public UDeveloperSettings

Source code excerpt:


	UPROPERTY(config, EditAnywhere, Category=Timeline, meta=(ConsoleVariable="LevelSequence.DefaultLockEngineToDisplayRate", Tooltip="0: Playback locked to playback frames\n1: Unlocked playback with sub frame interpolation"))
	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;