AnimRecorder.RecordInWorldSpace
AnimRecorder.RecordInWorldSpace
#Overview
name: AnimRecorder.RecordInWorldSpace
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
True to record anim keys in world space, false to record only in local space.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of AnimRecorder.RecordInWorldSpace is to control whether animation keys are recorded in world space or local space during animation recording in Unreal Engine 5.
This setting variable is primarily used by the Sequence Recorder module, which is part of the Editor subsystem in Unreal Engine 5. It affects how animations are captured and stored during the recording process.
The value of this variable is set as a console variable (CVar) with an initial value of 1 (true). It can be changed at runtime through the console or programmatically.
The associated variable CVarAnimRecorderWorldSpace directly interacts with AnimRecorder.RecordInWorldSpace. They share the same value and purpose.
Developers must be aware that:
- This variable affects the coordinate space of recorded animation keys.
- A value of 1 (true) means animations are recorded in world space, while 0 (false) means they are recorded in local space.
- Changing this value will impact the behavior of the Sequence Recorder and the resulting animations.
Best practices when using this variable include:
- Consider the intended use of the recorded animations when choosing between world space and local space recording.
- Be consistent in your choice across related animations to ensure compatibility and ease of use in animation blueprints and sequencers.
- Document your choice for team members to understand the recording setup.
Regarding the associated variable CVarAnimRecorderWorldSpace:
- It is an auto console variable of type int32.
- It is defined in the SequenceRecorderModule.cpp file.
- Its value is used to update the DefaultAnimationSettings.bRecordInWorldSpace property of the USequenceRecorderSettings class.
- When changed, it triggers a callback that updates the USequenceRecorderSettings accordingly.
Developers should note that modifying CVarAnimRecorderWorldSpace will directly affect the behavior of the Sequence Recorder module and should be done with consideration for the entire animation pipeline in their project.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/SequenceRecorder/Private/SequenceRecorderModule.cpp:88
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarAnimRecorderWorldSpace(
TEXT("AnimRecorder.RecordInWorldSpace"),
1,
TEXT("True to record anim keys in world space, false to record only in local space."),
ECVF_Default);
class FSequenceRecorderSettingsTabFactory : public FWorkflowTabFactory
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarAnimRecorderWorldSpace
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/SequenceRecorder/Private/SequenceRecorderModule.cpp:87
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<int32> CVarAnimRecorderWorldSpace(
TEXT("AnimRecorder.RecordInWorldSpace"),
1,
TEXT("True to record anim keys in world space, false to record only in local space."),
ECVF_Default);
class FSequenceRecorderSettingsTabFactory : public FWorkflowTabFactory
#Loc: <Workspace>/Engine/Source/Editor/SequenceRecorder/Private/SequenceRecorderModule.cpp:134
Scope (from outer to inner):
file
class class FSequenceRecorderModule : public ISequenceRecorder, private FSelfRegisteringExec
function virtual void StartupModule
Source code excerpt:
}));
CVarAnimRecorderWorldSpace.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* Variable)
{
GetMutableDefault<USequenceRecorderSettings>()->DefaultAnimationSettings.bRecordInWorldSpace = (CVarAnimRecorderWorldSpace.GetValueOnGameThread() != 0);
}));
FSequenceRecorderCommands::Register();
// init sequence recorder
FSequenceRecorder::Get().Initialize();