ControlRig.DisableExecutionInComponent
ControlRig.DisableExecutionInComponent
#Overview
name: ControlRig.DisableExecutionInComponent
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
if nonzero we disable the execution of Control Rigs inside a ControlRigComponent.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ControlRig.DisableExecutionInComponent
is to provide a way to disable the execution of Control Rigs inside a ControlRigComponent. This setting is primarily used for debugging and performance testing purposes in the animation system of Unreal Engine.
This setting variable is utilized by the Control Rig plugin, which is part of Unreal Engine’s animation system. Specifically, it’s used within the ControlRigComponent, which is responsible for managing and executing Control Rigs in the game.
The value of this variable is set through a console variable (CVar) named CVarControlRigDisableExecutionComponent
. It’s initialized with a default value of 0, meaning that Control Rig execution is enabled by default.
The associated variable CVarControlRigDisableExecutionComponent
directly interacts with ControlRig.DisableExecutionInComponent
. They share the same value and purpose.
Developers must be aware that when this variable is set to a non-zero value, it will prevent all Control Rigs from executing within ControlRigComponents. This can have a significant impact on the animation behavior in the game, as Control Rigs are often used for complex, procedural animations.
Best practices when using this variable include:
- Use it primarily for debugging and performance testing purposes.
- Be cautious when enabling it in a production environment, as it will disable all Control Rig executions in components.
- Remember to reset it to 0 after debugging to re-enable Control Rig execution.
- Consider using it in conjunction with other debugging tools to isolate animation-related issues.
Regarding the associated variable CVarControlRigDisableExecutionComponent
:
This is a console variable of type TAutoConsoleVariable<int32>
that directly controls the behavior defined by ControlRig.DisableExecutionInComponent
. It’s used in the UControlRigComponent::CanExecute()
function to determine whether the Control Rig should be allowed to execute.
The CanExecute()
function checks if CVarControlRigDisableExecutionComponent
is non-zero. If it is, the function returns false, preventing the Control Rig from executing.
Developers should be aware that changing this console variable at runtime will immediately affect all ControlRigComponents in the game. It’s a powerful tool for quickly toggling Control Rig execution on and off, which can be useful for performance profiling or isolating animation issues.
Best practices for using CVarControlRigDisableExecutionComponent
include:
- Use it in conjunction with performance profiling tools to measure the impact of Control Rig execution on game performance.
- Consider exposing it as a debug option in development builds for easy toggling during playtesting.
- Be cautious about changing its value in shipping builds, as it could lead to unexpected animation behavior.
- Document its usage clearly in your project to ensure other team members understand its impact on the animation system.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRig/Private/ControlRigComponent.cpp:17
Scope: file
Source code excerpt:
// CVar to disable control rig execution within a component
static TAutoConsoleVariable<int32> CVarControlRigDisableExecutionComponent(TEXT("ControlRig.DisableExecutionInComponent"), 0, TEXT("if nonzero we disable the execution of Control Rigs inside a ControlRigComponent."));
FControlRigAnimInstanceProxy* FControlRigComponentMappedElement::GetAnimProxyOnGameThread() const
{
if (USkeletalMeshComponent* SkeletalMeshComponent = Cast<USkeletalMeshComponent>(SceneComponent))
{
if (UControlRigAnimInstance* AnimInstance = Cast<UControlRigAnimInstance>(SkeletalMeshComponent->GetAnimInstance()))
#Associated Variable and Callsites
This variable is associated with another variable named CVarControlRigDisableExecutionComponent
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRig/Private/ControlRigComponent.cpp:17
Scope: file
Source code excerpt:
// CVar to disable control rig execution within a component
static TAutoConsoleVariable<int32> CVarControlRigDisableExecutionComponent(TEXT("ControlRig.DisableExecutionInComponent"), 0, TEXT("if nonzero we disable the execution of Control Rigs inside a ControlRigComponent."));
FControlRigAnimInstanceProxy* FControlRigComponentMappedElement::GetAnimProxyOnGameThread() const
{
if (USkeletalMeshComponent* SkeletalMeshComponent = Cast<USkeletalMeshComponent>(SceneComponent))
{
if (UControlRigAnimInstance* AnimInstance = Cast<UControlRigAnimInstance>(SkeletalMeshComponent->GetAnimInstance()))
#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRig/Private/ControlRigComponent.cpp:291
Scope (from outer to inner):
file
function bool UControlRigComponent::CanExecute
Source code excerpt:
bool UControlRigComponent::CanExecute()
{
if(CVarControlRigDisableExecutionComponent->GetInt() != 0)
{
return false;
}
if(UControlRig* CR = GetControlRig())
{