MovieScene.LegacyConversionFrameRate

MovieScene.LegacyConversionFrameRate

#Overview

name: MovieScene.LegacyConversionFrameRate

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of MovieScene.LegacyConversionFrameRate is to specify the default tick resolution for UMovieScene data saved before Unreal Engine 4.20. This setting is primarily used for the Movie Scene system, which is part of Unreal Engine’s cinematics and sequencer functionality.

This setting variable is relied upon by the MovieScene module, which is part of Unreal Engine’s runtime system. It’s specifically used for handling legacy data conversion in the sequencer system.

The value of this variable is set through a console variable (CVarLegacyConversionFrameRate) with a default value of “60000fps”. It can be changed at runtime through the console or configuration files.

The associated variable CVarLegacyConversionFrameRate interacts directly with MovieScene.LegacyConversionFrameRate. It’s defined as a TAutoConsoleVariable, allowing it to be modified during runtime.

Developers must be aware that this variable affects how older UMovieScene data is interpreted. Changing this value could potentially cause issues with existing content created before UE 4.20. It’s crucial to understand the implications of modifying this value, especially for projects that may contain legacy data.

Best practices when using this variable include:

  1. Only modify it if absolutely necessary and you understand the implications.
  2. If modifying, ensure all relevant team members are aware of the change.
  3. Test thoroughly with any existing content to ensure no unexpected behavior occurs.
  4. Document any changes made to this variable for future reference.

Regarding the associated variable CVarLegacyConversionFrameRate:

This is a console variable that directly controls the MovieScene.LegacyConversionFrameRate setting. It’s defined using the TAutoConsoleVariable template, which allows it to be changed at runtime through the console or configuration files.

The purpose of CVarLegacyConversionFrameRate is to provide a user-friendly way to modify the legacy conversion frame rate. It accepts various formats for specifying the frame rate, including “fps”, fractional representations, and time-based formats.

This variable is used within the MovieScene module to update the actual frame rate used for legacy data conversion. There’s a callback (OnChanged) that updates the frame rate whenever the console variable changes.

Developers should be aware that changes to this variable will immediately affect how legacy MovieScene data is interpreted. It’s important to use valid frame rate values and to understand the potential impact on existing content.

Best practices for using CVarLegacyConversionFrameRate include:

  1. Use clear, unambiguous frame rate specifications (e.g., “60000fps” or “30000/1001” for 29.97 fps).
  2. Be cautious when changing this value in a production environment.
  3. Always test changes thoroughly with existing content.
  4. Consider creating a backup of affected content before making significant changes to this variable.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneModule.cpp:14

Scope: file

Source code excerpt:


TAutoConsoleVariable<FString> CVarLegacyConversionFrameRate(
	TEXT("MovieScene.LegacyConversionFrameRate"),
	TEXT("60000fps"),
	TEXT("Specifies default tick resolution for UMovieScene data saved before 4.20 (default: 60000fps). Examples: 60000 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."),
	ECVF_Default);

struct FCachedLegacyConversionFrameRate
{

#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneModule.cpp:56

Scope (from outer to inner):

file
function     void EmitLegacyOutOfBoundsError

Source code excerpt:


	const FText Message = FText::Format(
		NSLOCTEXT("MovieScene", "LegacyOutOfBoundsError", "Encountered time ({0} seconds) that is out of the supported range with a resolution of {1}fps. Saving this asset will cause loss of data. Please reduce MovieScene.LegacyConversionFrameRate and re-load this asset."),
		InTime, InFrameRate.AsDecimal()
	);
	AssetCheckLog.Error()
		->AddToken(FUObjectToken::Create(Object))
		->AddToken(FTextToken::Create(Message));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneModule.cpp:13

Scope: file

Source code excerpt:

DEFINE_LOG_CATEGORY(LogMovieSceneECS);

TAutoConsoleVariable<FString> CVarLegacyConversionFrameRate(
	TEXT("MovieScene.LegacyConversionFrameRate"),
	TEXT("60000fps"),
	TEXT("Specifies default tick resolution for UMovieScene data saved before 4.20 (default: 60000fps). Examples: 60000 fps, 120/1 (120 fps), 30000/1001 (29.97), 0.01s (10ms)."),
	ECVF_Default);

struct FCachedLegacyConversionFrameRate

#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneModule.cpp:35

Scope (from outer to inner):

file
function     void OnChanged

Source code excerpt:

	void OnChanged()
	{
		TryParseString(FrameRate, *CVarLegacyConversionFrameRate.GetValueOnGameThread());
	}

	FFrameRate FrameRate;
	FConsoleVariableSinkHandle DelegateHandle;
};