p.AnimDynamics.ComponentAppliedLinearAccClampOverride
p.AnimDynamics.ComponentAppliedLinearAccClampOverride
#Overview
name: p.AnimDynamics.ComponentAppliedLinearAccClampOverride
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Override the per asset setting for all axis (X,Y & Z) of ComponentAppliedLinearAccClamp for all Anim Dynamics Nodes. Negative values are ignored.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.AnimDynamics.ComponentAppliedLinearAccClampOverride is to provide a global override for the component-applied linear acceleration clamp in the Animation Dynamics system of Unreal Engine 5. This setting is specifically related to the animation system, particularly the dynamic animation features.
This setting variable is primarily used in the AnimGraphRuntime module, which is responsible for handling advanced animation graph operations, including dynamic animations.
The value of this variable is set through a console variable (CVarComponentAppliedLinearAccClampOverride) with a default value of -1.0f. It can be changed at runtime through console commands or programmatically.
This variable interacts with the ComponentAppliedLinearAccClamp property of individual AnimDynamics nodes. When the override value is set to a non-negative number, it replaces the per-asset setting for all axes (X, Y, and Z) of ComponentAppliedLinearAccClamp for all AnimDynamics nodes.
Developers must be aware that:
- Negative values for this override are ignored, maintaining the per-asset settings.
- When set, this override applies globally to all AnimDynamics nodes, which could have wide-ranging effects on animations throughout the project.
Best practices when using this variable include:
- Use it sparingly and primarily for debugging or testing purposes.
- Be cautious when applying it in a production environment, as it affects all AnimDynamics nodes.
- Consider using per-asset settings for more fine-grained control in most cases.
Regarding the associated variable CVarComponentAppliedLinearAccClampOverride:
This is the actual console variable that controls the p.AnimDynamics.ComponentAppliedLinearAccClampOverride setting. It’s defined as a TAutoConsoleVariable
The purpose of this variable is to provide a way to access and modify the ComponentAppliedLinearAccClampOverride value through the console or programmatically.
It’s used in the AnimGraphRuntime module, specifically within the FAnimNode_AnimDynamics::EvaluateSkeletalControl_AnyThread function.
The value is retrieved using the GetValueOnAnyThread() method, which suggests it’s designed to be thread-safe for use in multi-threaded animation calculations.
Developers should be aware that changes to this variable take effect immediately and globally. They should use it cautiously, especially in performance-critical or gameplay-sensitive areas.
Best practices for using this variable include:
- Use it for debugging or prototyping purposes.
- Document any use of this override clearly, as it can affect the behavior of animations project-wide.
- Consider reverting to default values (-1.0f) after testing to ensure expected behavior in regular gameplay.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_AnimDynamics.cpp:24
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarAdaptiveSubstepNumDebtFrames(TEXT("p.AnimDynamicsNumDebtFrames"), 5, TEXT("Number of frames to maintain as time debt when using adaptive substepping, this should be at least 1 or the time debt will never be cleared."));
TAutoConsoleVariable<int32> CVarEnableWind(TEXT("p.AnimDynamicsWind"), 1, TEXT("Enables/Disables anim dynamics wind forces globally."), ECVF_Scalability);
TAutoConsoleVariable<float> CVarComponentAppliedLinearAccClampOverride(TEXT("p.AnimDynamics.ComponentAppliedLinearAccClampOverride"), -1.0f, TEXT("Override the per asset setting for all axis (X,Y & Z) of ComponentAppliedLinearAccClamp for all Anim Dynamics Nodes. Negative values are ignored."));
TAutoConsoleVariable<float> CVarGravityScale(TEXT("p.AnimDynamics.GravityScale"), 1.0f, TEXT("Multiplies the defalut gravity and the gravity override on all Anim Dynamics Nodes."));
// FindChainBones
//
// Returns an ordered list of the names of all the bones in a chain between BeginBoneName and EndBoneName.
//
#Associated Variable and Callsites
This variable is associated with another variable named CVarComponentAppliedLinearAccClampOverride
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_AnimDynamics.cpp:24
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarAdaptiveSubstepNumDebtFrames(TEXT("p.AnimDynamicsNumDebtFrames"), 5, TEXT("Number of frames to maintain as time debt when using adaptive substepping, this should be at least 1 or the time debt will never be cleared."));
TAutoConsoleVariable<int32> CVarEnableWind(TEXT("p.AnimDynamicsWind"), 1, TEXT("Enables/Disables anim dynamics wind forces globally."), ECVF_Scalability);
TAutoConsoleVariable<float> CVarComponentAppliedLinearAccClampOverride(TEXT("p.AnimDynamics.ComponentAppliedLinearAccClampOverride"), -1.0f, TEXT("Override the per asset setting for all axis (X,Y & Z) of ComponentAppliedLinearAccClamp for all Anim Dynamics Nodes. Negative values are ignored."));
TAutoConsoleVariable<float> CVarGravityScale(TEXT("p.AnimDynamics.GravityScale"), 1.0f, TEXT("Multiplies the defalut gravity and the gravity override on all Anim Dynamics Nodes."));
// FindChainBones
//
// Returns an ordered list of the names of all the bones in a chain between BeginBoneName and EndBoneName.
//
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_AnimDynamics.cpp:349
Scope (from outer to inner):
file
function void FAnimNode_AnimDynamics::EvaluateSkeletalControl_AnyThread
Source code excerpt:
FVector LinearAccClamp = ComponentAppliedLinearAccClamp;
const float LinearAccClampOverride = CVarComponentAppliedLinearAccClampOverride.GetValueOnAnyThread();
if (LinearAccClampOverride >= 0.0f) // Ignore values < 0
{
LinearAccClamp.Set(LinearAccClampOverride, LinearAccClampOverride, LinearAccClampOverride);
}
ComponentLinearAcc = ComponentLinearAcc.BoundToBox(-LinearAccClamp, LinearAccClamp);