ControlRig.Hierarchy.Modules

ControlRig.Hierarchy.Modules

#Overview

name: ControlRig.Hierarchy.Modules

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

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ControlRig.Hierarchy.Modules is to enable or disable the modular rigging functionality in Unreal Engine’s Control Rig system. This setting variable is primarily used in the animation system, specifically within the Control Rig plugin.

The Control Rig plugin and its associated modules rely on this setting variable. It is used in various parts of the Control Rig system, including the ControlRigEditor, ControlRigBlueprintDetails, and RigHierarchy.

The value of this variable is set as a console variable (cvar) in the Unreal Engine configuration. It is defined as a boolean value, with a default setting of true, enabling modular rigging functionality by default.

The associated variable CVarControlRigHierarchyEnableModules interacts directly with this setting. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable controls the availability of certain features in the Control Rig system. When disabled, it may limit functionality related to modular rigging, such as the ability to add connector or socket items to the rig hierarchy.

Best practices when using this variable include:

  1. Ensuring it is enabled when working with modular rigging features.
  2. Being aware of its state when debugging issues related to Control Rig functionality.
  3. Considering performance implications if enabling or disabling this feature in runtime scenarios.

Regarding the associated variable CVarControlRigHierarchyEnableModules:

This variable serves the same purpose as ControlRig.Hierarchy.Modules, enabling or disabling modular rigging functionality. It is used in the same Control Rig subsystem and is referenced in multiple parts of the Control Rig plugin’s code.

The value of CVarControlRigHierarchyEnableModules is set in the same way as ControlRig.Hierarchy.Modules, through the console variable system.

This variable directly interacts with ControlRig.Hierarchy.Modules, sharing the same value and purpose.

Developers should treat CVarControlRigHierarchyEnableModules the same way as ControlRig.Hierarchy.Modules, being aware of its impact on modular rigging functionality and considering its state when working with Control Rig features.

The best practices for using CVarControlRigHierarchyEnableModules are the same as those for ControlRig.Hierarchy.Modules, focusing on proper enablement for modular rigging tasks and consideration of performance impacts.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRig/Private/Rigs/RigHierarchy.cpp:48

Scope: file

Source code excerpt:

static TAutoConsoleVariable<int32> CVarControlRigHierarchyTraceOnSpawn(TEXT("ControlRig.Hierarchy.TraceOnSpawn"), 0, TEXT("sets the number of frames to trace when a new hierarchy is spawned"));
TAutoConsoleVariable<bool> CVarControlRigHierarchyEnableRotationOrder(TEXT("ControlRig.Hierarchy.EnableRotationOrder"), true, TEXT("enables the rotation order for controls"));
TAutoConsoleVariable<bool> CVarControlRigHierarchyEnableModules(TEXT("ControlRig.Hierarchy.Modules"), true, TEXT("enables the modular rigging functionality"));
static int32 sRigHierarchyLastTrace = INDEX_NONE;
static TCHAR sRigHierarchyTraceFormat[16];

// A console command to trace a single frame / single execution for a control rig anim node / control rig component
FAutoConsoleCommandWithWorldAndArgs FCmdControlRigHierarchyTraceFrames
(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRig/Private/Rigs/RigHierarchy.cpp:48

Scope: file

Source code excerpt:

static TAutoConsoleVariable<int32> CVarControlRigHierarchyTraceOnSpawn(TEXT("ControlRig.Hierarchy.TraceOnSpawn"), 0, TEXT("sets the number of frames to trace when a new hierarchy is spawned"));
TAutoConsoleVariable<bool> CVarControlRigHierarchyEnableRotationOrder(TEXT("ControlRig.Hierarchy.EnableRotationOrder"), true, TEXT("enables the rotation order for controls"));
TAutoConsoleVariable<bool> CVarControlRigHierarchyEnableModules(TEXT("ControlRig.Hierarchy.Modules"), true, TEXT("enables the modular rigging functionality"));
static int32 sRigHierarchyLastTrace = INDEX_NONE;
static TCHAR sRigHierarchyTraceFormat[16];

// A console command to trace a single frame / single execution for a control rig anim node / control rig component
FAutoConsoleCommandWithWorldAndArgs FCmdControlRigHierarchyTraceFrames
(

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRig/Public/Rigs/RigHierarchy.h:30

Scope: file

Source code excerpt:


extern CONTROLRIG_API TAutoConsoleVariable<bool> CVarControlRigHierarchyEnableRotationOrder;
extern CONTROLRIG_API TAutoConsoleVariable<bool> CVarControlRigHierarchyEnableModules;

UENUM()
enum ERigTransformStackEntryType : int
{
	TransformPose,
	ControlOffset,

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/ControlRigBlueprintDetails.cpp:12

Scope (from outer to inner):

file
function     void FControlRigBlueprintDetails::CustomizeDetails

Source code excerpt:

void FControlRigBlueprintDetails::CustomizeDetails(IDetailLayoutBuilder& DetailLayout)
{
	bool bIsValidRigModule = CVarControlRigHierarchyEnableModules.GetValueOnAnyThread();
	if(bIsValidRigModule)
	{
		bIsValidRigModule = false;
		
		TArray<TWeakObjectPtr<UObject>> DetailObjects;
		DetailLayout.GetObjectsBeingCustomized(DetailObjects);

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/ControlRigBlueprintFactory.cpp:274

Scope (from outer to inner):

file
function     bool UControlRigBlueprintFactory::ConfigureProperties

Source code excerpt:

bool UControlRigBlueprintFactory::ConfigureProperties()
{
	if (CVarControlRigHierarchyEnableModules.GetValueOnAnyThread())
	{
		TSharedRef<SControlRigBlueprintCreateDialog> Dialog = SNew(SControlRigBlueprintCreateDialog);
		return Dialog->ConfigureProperties(this);
	}
	return true;
};

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Editor/ControlRigEditor.cpp:661

Scope (from outer to inner):

file
function     void FControlRigEditor::FillToolbar

Source code excerpt:

	
	{
		if(CVarControlRigHierarchyEnableModules.GetValueOnAnyThread())
		{
			TWeakObjectPtr<UControlRigBlueprint> WeakBlueprint = GetControlRigBlueprint();
			ToolbarBuilder.AddToolBarButton(
				FUIAction(
					FExecuteAction::CreateLambda([WeakBlueprint]()
					{

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Editor/SRigHierarchy.cpp:1267

Scope (from outer to inner):

file
lambda-function
lambda-function

Source code excerpt:

							DefaultSection.AddMenuEntry(Commands.AddNullItem);

							if(CVarControlRigHierarchyEnableModules.GetValueOnAnyThread())
							{
								DefaultSection.AddMenuEntry(Commands.AddConnectorItem);
								DefaultSection.AddMenuEntry(Commands.AddSocketItem);
							}
						})
					);