ControlRig.Sequencer.SelectedKeysSelectControls
ControlRig.Sequencer.SelectedKeysSelectControls
#Overview
name: ControlRig.Sequencer.SelectedKeysSelectControls
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When true when we select a key in Sequencer it will select the Control, by default false.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ControlRig.Sequencer.SelectedKeysSelectControls is to control the behavior of the Sequencer in Unreal Engine 5 when selecting keys in relation to Control Rig controls. This setting is specifically for the animation system, particularly the Control Rig feature in the Sequencer.
This setting variable is primarily used in the Control Rig module, which is part of the animation system in Unreal Engine 5. Based on the callsites, it’s specifically utilized in the ControlRigEditor subsystem, particularly in the ControlRigParameterTrackEditor.
The value of this variable is set as a console variable (CVar) in the C++ code. It’s initialized to false by default, meaning that selecting keys in the Sequencer will not automatically select the corresponding Control Rig controls unless explicitly enabled.
The associated variable CVarSelectedKeysSelectControls directly interacts with this setting. They share the same value and purpose.
Developers must be aware that this variable affects the selection behavior in the Sequencer when working with Control Rig animations. When enabled, selecting a key in the Sequencer will also select the corresponding Control in the Control Rig.
Best practices for using this variable include:
- Consider enabling it (set to true) when you want a more direct correlation between key selection in the Sequencer and control selection in the Control Rig.
- Keep it disabled (set to false) if you prefer to have separate selection states between Sequencer keys and Control Rig controls.
- Be mindful of this setting when developing tools or workflows that involve both the Sequencer and Control Rig, as it can affect user interaction and automation scripts.
Regarding the associated variable CVarSelectedKeysSelectControls:
The purpose of CVarSelectedKeysSelectControls is identical to ControlRig.Sequencer.SelectedKeysSelectControls. It’s a console variable representation of the same setting.
This variable is used in the ControlRigEditor module, specifically in the ControlRigParameterTrackEditor class. It’s queried during the selection change process in the Sequencer.
The value is set when the console variable is initialized in the C++ code, defaulting to false.
It directly interacts with the ControlRig.Sequencer.SelectedKeysSelectControls setting, as they represent the same functionality.
Developers should be aware that this is the actual variable used in the code to check the setting’s value. It’s accessed using the GetValueOnGameThread() method.
Best practices include using this variable consistently throughout the codebase when checking for this setting, and considering its value when implementing features that involve key selection in the Sequencer and its interaction with Control Rig controls.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Sequencer/ControlRigParameterTrackEditor.cpp:109
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarAutoGenerateControlRigTrack(TEXT("ControlRig.Sequencer.AutoGenerateTrack"), true, TEXT("When true automatically create control rig tracks in Sequencer when a control rig is added to a level."));
TAutoConsoleVariable<bool> CVarSelectedKeysSelectControls(TEXT("ControlRig.Sequencer.SelectedKeysSelectControls"), false, TEXT("When true when we select a key in Sequencer it will select the Control, by default false."));
TAutoConsoleVariable<bool> CVarSelectedSectionSetsSectionToKey(TEXT("ControlRig.Sequencer.SelectedSectionSetsSectionToKey"), true, TEXT("When true when we select a channel in a section, if it's the only section selected we set it as the Section To Key, by default false."));
TAutoConsoleVariable<bool> CVarEnableAdditiveControlRigs(TEXT("ControlRig.Sequencer.EnableAdditiveControlRigs"), true, TEXT("When true it is possible to add an additive control rig to a skeletal mesh component."));
static USkeletalMeshComponent* AcquireSkeletalMeshFromObject(UObject* BoundObject, TSharedPtr<ISequencer> SequencerPtr)
#Associated Variable and Callsites
This variable is associated with another variable named CVarSelectedKeysSelectControls
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Sequencer/ControlRigParameterTrackEditor.cpp:109
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarAutoGenerateControlRigTrack(TEXT("ControlRig.Sequencer.AutoGenerateTrack"), true, TEXT("When true automatically create control rig tracks in Sequencer when a control rig is added to a level."));
TAutoConsoleVariable<bool> CVarSelectedKeysSelectControls(TEXT("ControlRig.Sequencer.SelectedKeysSelectControls"), false, TEXT("When true when we select a key in Sequencer it will select the Control, by default false."));
TAutoConsoleVariable<bool> CVarSelectedSectionSetsSectionToKey(TEXT("ControlRig.Sequencer.SelectedSectionSetsSectionToKey"), true, TEXT("When true when we select a channel in a section, if it's the only section selected we set it as the Section To Key, by default false."));
TAutoConsoleVariable<bool> CVarEnableAdditiveControlRigs(TEXT("ControlRig.Sequencer.EnableAdditiveControlRigs"), true, TEXT("When true it is possible to add an additive control rig to a skeletal mesh component."));
static USkeletalMeshComponent* AcquireSkeletalMeshFromObject(UObject* BoundObject, TSharedPtr<ISequencer> SequencerPtr)
#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Sequencer/ControlRigParameterTrackEditor.cpp:2274
Scope (from outer to inner):
file
function void FControlRigParameterTrackEditor::OnSelectionChanged
Source code excerpt:
TArray<const IKeyArea*> KeyAreas;
const bool UseSelectedKeys = CVarSelectedKeysSelectControls.GetValueOnGameThread();
GetSequencer()->GetSelectedKeyAreas(KeyAreas, UseSelectedKeys);
if (KeyAreas.Num() <= 0)
{
if (FSlateApplication::Get().GetModifierKeys().IsShiftDown() == false &&
FSlateApplication::Get().GetModifierKeys().IsControlDown() == false && ControlRigEditMode)
{