ControlRig.Sequencer.AutoGenerateTrack

ControlRig.Sequencer.AutoGenerateTrack

#Overview

name: ControlRig.Sequencer.AutoGenerateTrack

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ControlRig.Sequencer.AutoGenerateTrack is to control the automatic creation of control rig tracks in Sequencer when a control rig is added to a level.

This setting variable is primarily used by the ControlRig plugin, specifically within the Sequencer subsystem of Unreal Engine 5. It’s part of the animation system, focusing on the integration between ControlRig and Sequencer.

The value of this variable is set using a console variable (CVar) named CVarAutoGenerateControlRigTrack. It’s initialized with a default value of true, meaning that by default, control rig tracks will be automatically generated in Sequencer when a control rig is added to a level.

The associated variable CVarAutoGenerateControlRigTrack directly interacts with this setting. They share the same value and purpose.

Developers must be aware that this variable affects the workflow in Sequencer when working with control rigs. When set to true, it can save time by automatically creating necessary tracks, but it may also lead to unexpected track creation if not managed properly.

Best practices when using this variable include:

  1. Be aware of its current state when working with control rigs in Sequencer.
  2. Consider turning it off if you prefer manual control over track creation in your workflow.
  3. Use it in conjunction with other ControlRig-related settings for a cohesive setup.

The associated variable CVarAutoGenerateControlRigTrack is a TAutoConsoleVariable that directly controls the behavior described. It’s used in the HandleActorAdded function of the FControlRigParameterTrackEditor class to determine whether to proceed with automatic track generation when a new actor with a UControlRigComponent is added.

Developers should note that changing this variable’s value at runtime will affect the behavior of the Sequencer immediately. It’s important to communicate any changes to this setting to team members to ensure consistent workflow across the project.

#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:107

Scope: file

Source code excerpt:

TArray <TPair<UClass*, TArray<FName>>> FControlRigParameterTrackEditor::PreviousSelectedControlRigs;

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."));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Sequencer/ControlRigParameterTrackEditor.cpp:107

Scope: file

Source code excerpt:

TArray <TPair<UClass*, TArray<FName>>> FControlRigParameterTrackEditor::PreviousSelectedControlRigs;

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."));

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Sequencer/ControlRigParameterTrackEditor.cpp:2113

Scope (from outer to inner):

file
function     void FControlRigParameterTrackEditor::HandleActorAdded

Source code excerpt:

	//test for control rig

	if (!CVarAutoGenerateControlRigTrack.GetValueOnGameThread())
	{
		return;
	}

	if (UControlRigComponent* ControlRigComponent = Actor->FindComponentByClass<UControlRigComponent>())
	{