AnimRecorder.AnimLength
AnimRecorder.AnimLength
#Overview
name: AnimRecorder.AnimLength
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Sets default animation length for the animation recorder system.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of AnimRecorder.AnimLength is to set the default animation length for the animation recorder system in Unreal Engine 5. This setting variable is primarily used for the animation recording functionality within the engine.
The Unreal Engine subsystem that relies on this setting variable is the Sequence Recorder module, which is part of the Editor subsystem. This can be inferred from the file path Engine/Source/Editor/SequenceRecorder/Private/SequenceRecorderModule.cpp
.
The value of this variable is set through a console variable (CVar) system. It is initialized with the default value of FAnimationRecordingSettings::DefaultMaximumLength
.
This variable interacts with the USequenceRecorderSettings
class, specifically the DefaultAnimationSettings.Length
property. When the console variable changes, it updates the corresponding setting in the USequenceRecorderSettings
class.
Developers must be aware that changing this variable will affect the default maximum length of recorded animations throughout the project. It’s important to consider the performance and storage implications of setting this value too high.
Best practices when using this variable include:
- Setting an appropriate value that balances between capturing enough animation data and managing resource usage.
- Considering project-specific needs when adjusting this value.
- Being aware that this sets a default, which can potentially be overridden in specific use cases.
Regarding the associated variable CVarDefaultRecordedAnimLength:
The purpose of CVarDefaultRecordedAnimLength is to provide a console-accessible way to modify the AnimRecorder.AnimLength setting. It serves as the actual console variable that controls the animation length setting.
This variable is part of the Sequence Recorder module in the Editor subsystem, just like AnimRecorder.AnimLength.
The value of CVarDefaultRecordedAnimLength is set when it’s created, using the same default value as AnimRecorder.AnimLength. It can be modified at runtime through console commands.
CVarDefaultRecordedAnimLength directly interacts with the USequenceRecorderSettings class. When its value changes, it triggers a callback that updates the DefaultAnimationSettings.Length property of USequenceRecorderSettings.
Developers should be aware that changing CVarDefaultRecordedAnimLength through the console will have an immediate effect on the default animation recording length in the project.
Best practices for using CVarDefaultRecordedAnimLength include:
- Using it for quick testing or debugging of different animation lengths without recompiling the project.
- Considering adding it to a list of important CVars for the project, allowing for easy adjustment in different development or runtime scenarios.
- Documenting its use and effects for other team members, especially if it’s frequently adjusted during development.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/SequenceRecorder/Private/SequenceRecorderModule.cpp:54
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarDefaultRecordedAnimLength(
TEXT("AnimRecorder.AnimLength"),
FAnimationRecordingSettings::DefaultMaximumLength,
TEXT("Sets default animation length for the animation recorder system."),
ECVF_Default);
static FAutoConsoleCommand CVarAnimRecorderSampleFrameRate(
TEXT("AnimRecorder.SampleRate"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarDefaultRecordedAnimLength
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/SequenceRecorder/Private/SequenceRecorderModule.cpp:53
Scope: file
Source code excerpt:
static const FName SequenceRecorderTabName(TEXT("SequenceRecorder"));
static TAutoConsoleVariable<float> CVarDefaultRecordedAnimLength(
TEXT("AnimRecorder.AnimLength"),
FAnimationRecordingSettings::DefaultMaximumLength,
TEXT("Sets default animation length for the animation recorder system."),
ECVF_Default);
static FAutoConsoleCommand CVarAnimRecorderSampleFrameRate(
#Loc: <Workspace>/Engine/Source/Editor/SequenceRecorder/Private/SequenceRecorderModule.cpp:129
Scope (from outer to inner):
file
class class FSequenceRecorderModule : public ISequenceRecorder, private FSelfRegisteringExec
function virtual void StartupModule
Source code excerpt:
// set cvar defaults
CVarDefaultRecordedAnimLength.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* Variable)
{
GetMutableDefault<USequenceRecorderSettings>()->DefaultAnimationSettings.Length = CVarDefaultRecordedAnimLength.GetValueOnGameThread();
}));
CVarAnimRecorderWorldSpace.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* Variable)
{
GetMutableDefault<USequenceRecorderSettings>()->DefaultAnimationSettings.bRecordInWorldSpace = (CVarAnimRecorderWorldSpace.GetValueOnGameThread() != 0);
}));