ControlRig.Hierarchy.EnableRotationOrder

ControlRig.Hierarchy.EnableRotationOrder

#Overview

name: ControlRig.Hierarchy.EnableRotationOrder

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ControlRig.Hierarchy.EnableRotationOrder is to enable or disable the rotation order functionality for controls in the Control Rig system of Unreal Engine 5. This setting is primarily used in the animation system, specifically within the Control Rig plugin.

The Control Rig plugin, which is part of Unreal Engine’s animation system, relies on this setting variable. It is used in the RigHierarchy component of the Control Rig system.

The value of this variable is set as a console variable (cvar) with a default value of true. It can be modified at runtime through the console or programmatically.

This variable interacts closely with the CVarControlRigHierarchyEnableRotationOrder variable, which is its associated variable. They share the same value and purpose.

Developers must be aware that this variable affects the behavior of rotation controls in the Control Rig system. When enabled, it allows for the use of preferred rotation orders for Euler transforms.

Best practices when using this variable include:

  1. Considering the impact on existing animations and rigs when changing this setting.
  2. Testing thoroughly after modifying this setting to ensure desired behavior in all affected animations.
  3. Documenting any changes to this setting in project documentation to maintain consistency across the development team.

Regarding the associated variable CVarControlRigHierarchyEnableRotationOrder:

The purpose of CVarControlRigHierarchyEnableRotationOrder is identical to ControlRig.Hierarchy.EnableRotationOrder. It is the actual C++ variable that controls the functionality within the engine’s code.

This variable is used in the Control Rig plugin, specifically in the RigHierarchy and ControlRigElementDetails classes.

The value is set as a console variable, initialized to true by default.

It directly interacts with the UI elements in the Control Rig editor, specifically enabling or disabling the “Use Preferred Rotation Order” option for Euler transform controls.

Developers should be aware that this variable directly affects the Control Rig editor’s UI and the underlying functionality of rotation order in the Control Rig system.

Best practices include:

  1. Using this variable consistently across the project to maintain predictable behavior.
  2. Considering performance implications when enabling or disabling this feature, especially in complex rigs.
  3. Ensuring that any custom tools or scripts interacting with the Control Rig system respect this setting.

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

Scope: file

Source code excerpt:

static TAutoConsoleVariable<int32> CVarControlRigHierarchyTracePrecision(TEXT("ControlRig.Hierarchy.TracePrecision"), 3, TEXT("sets the number digits in a float when tracing hierarchies."));
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 CVarControlRigHierarchyEnableRotationOrder. They share the same value. See the following C++ source code.

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

Scope: file

Source code excerpt:

static TAutoConsoleVariable<int32> CVarControlRigHierarchyTracePrecision(TEXT("ControlRig.Hierarchy.TracePrecision"), 3, TEXT("sets the number digits in a float when tracing hierarchies."));
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:29

Scope: file

Source code excerpt:

DECLARE_MULTICAST_DELEGATE_ThreeParams(FRigHierarchyMetadataTagChangedDelegate, const FRigElementKey& /* Key */, const FName& /* Tag */, bool /* AddedOrRemoved */);

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

UENUM()
enum ERigTransformStackEntryType : int
{
	TransformPose,

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

Scope (from outer to inner):

file
function     void FRigControlElementDetails::CustomizeControl

Source code excerpt:

	}

	if(CVarControlRigHierarchyEnableRotationOrder.GetValueOnAnyThread())
	{
		if(IsAnyControlOfValueType(ERigControlType::EulerTransform))
		{
			const TSharedPtr<IPropertyHandle> UsePreferredRotationOrderHandle = SettingsHandle->GetChildHandle(TEXT("bUsePreferredRotationOrder"));
			ControlCategory.AddProperty(UsePreferredRotationOrderHandle.ToSharedRef()).DisplayName(FText::FromString(TEXT("Use Preferred Rotation Order")))
				.IsEnabled(bIsEnabled);