a.AnimNode.SlopeWarping.Debug
a.AnimNode.SlopeWarping.Debug
#Overview
name: a.AnimNode.SlopeWarping.Debug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Turn on debug for AnimNode_SlopeWarping
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of a.AnimNode.SlopeWarping.Debug is to enable debugging for the Slope Warping animation node in Unreal Engine 5. This setting variable is specifically used for the animation system, particularly for the Slope Warping feature.
This setting variable is relied upon by the Animation Warping plugin, which is part of Unreal Engine’s animation system. It’s specifically used in the AnimNode_SlopeWarping class, which is responsible for implementing the slope warping functionality.
The value of this variable is set as a console variable (CVar) with an initial value of 0, meaning it’s disabled by default. It can be toggled on or off during runtime or through configuration files.
The associated variable CVarAnimNodeSlopeWarpingDebug directly interacts with a.AnimNode.SlopeWarping.Debug. They share the same value and purpose.
Developers must be aware that this debug variable is only compiled and available when ENABLE_ANIM_DEBUG is defined. This means it’s likely only available in development or debug builds, not in shipping builds.
Best practices when using this variable include:
- Only enable it when necessary for debugging, as it may impact performance.
- Be aware that it’s not available in shipping builds, so don’t rely on it for production code.
- Use it in conjunction with other debugging tools to get a comprehensive view of the Slope Warping system’s behavior.
Regarding the associated variable CVarAnimNodeSlopeWarpingDebug:
The purpose of CVarAnimNodeSlopeWarpingDebug is identical to a.AnimNode.SlopeWarping.Debug. It’s the actual C++ variable that controls the debug state of the Slope Warping animation node.
This variable is used within the AnimationWarping plugin, specifically in the AnimNode_SlopeWarping class.
The value of CVarAnimNodeSlopeWarpingDebug is set when the console variable a.AnimNode.SlopeWarping.Debug is modified. It’s checked in the EvaluateSkeletalControl_AnyThread function of the FAnimNode_SlopeWarping class to determine if debug visualization should be enabled.
No other variables directly interact with CVarAnimNodeSlopeWarpingDebug, but it works in tandem with CVarSlopeWarpingEnable, which toggles the entire Slope Warping feature.
Developers should be aware that this variable is only accessible when ENABLE_ANIM_DEBUG is defined, typically in non-shipping builds.
Best practices for using CVarAnimNodeSlopeWarpingDebug include:
- Use GetValueOnAnyThread() to safely access its value from any thread.
- Remember that enabling this debug feature may have performance implications, so use it judiciously.
- Combine it with in-engine visualization tools to get the most out of the debugging information it provides.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Animation/AnimationWarping/Source/Runtime/Private/BoneControllers/AnimNode_SlopeWarping.cpp:12
Scope: file
Source code excerpt:
#if ENABLE_ANIM_DEBUG
TAutoConsoleVariable<int32> CVarAnimNodeSlopeWarpingDebug(TEXT("a.AnimNode.SlopeWarping.Debug"), 0, TEXT("Turn on debug for AnimNode_SlopeWarping"));
#endif
TAutoConsoleVariable<int32> CVarSlopeWarpingEnable(TEXT("a.AnimNode.SlopeWarping.Enable"), 1, TEXT("Toggle Slope Warping"));
DECLARE_CYCLE_STAT(TEXT("Slope Warping Eval"), STAT_SlopeWarping_Eval, STATGROUP_Anim);
#Associated Variable and Callsites
This variable is associated with another variable named CVarAnimNodeSlopeWarpingDebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Animation/AnimationWarping/Source/Runtime/Private/BoneControllers/AnimNode_SlopeWarping.cpp:12
Scope: file
Source code excerpt:
#if ENABLE_ANIM_DEBUG
TAutoConsoleVariable<int32> CVarAnimNodeSlopeWarpingDebug(TEXT("a.AnimNode.SlopeWarping.Debug"), 0, TEXT("Turn on debug for AnimNode_SlopeWarping"));
#endif
TAutoConsoleVariable<int32> CVarSlopeWarpingEnable(TEXT("a.AnimNode.SlopeWarping.Enable"), 1, TEXT("Toggle Slope Warping"));
DECLARE_CYCLE_STAT(TEXT("Slope Warping Eval"), STAT_SlopeWarping_Eval, STATGROUP_Anim);
#Loc: <Workspace>/Engine/Plugins/Animation/AnimationWarping/Source/Runtime/Private/BoneControllers/AnimNode_SlopeWarping.cpp:283
Scope (from outer to inner):
file
function void FAnimNode_SlopeWarping::EvaluateSkeletalControl_AnyThread
Source code excerpt:
#if ENABLE_ANIM_DEBUG
bShowDebug = (CVarAnimNodeSlopeWarpingDebug.GetValueOnAnyThread() == 1);
#endif
const FCompactPoseBoneIndex IKFootRootBoneIndex = IKFootRootBone.GetCompactPoseIndex(RequiredBones);
FTransform IKFootRootTransform = Output.Pose.GetComponentSpaceTransform(IKFootRootBoneIndex);
if (!ensureMsgf(IKFootRootTransform.ContainsNaN() == false, TEXT("FAnimNode_SlopeWarping, Incoming IKFootRootTransform contains NaN (%s)"), *IKFootRootTransform.ToString()))
{