p.animdynamics.showdebug
p.animdynamics.showdebug
#Overview
name: p.animdynamics.showdebug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable/disable the drawing of animdynamics data.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.animdynamics.showdebug is to enable or disable the drawing of animation dynamics data for debugging purposes in Unreal Engine 5. This setting variable is primarily used for the animation system, specifically for the AnimDynamics feature.
The Unreal Engine subsystem that relies on this setting variable is the AnimGraphRuntime module, which is part of the animation system. This can be seen from the file path where the variable is defined and used: Engine/Source/Runtime/AnimGraphRuntime/.
The value of this variable is set through a console command. It is defined as a TAutoConsoleVariable with an initial value of 0, which means the debug drawing is disabled by default.
There is an associated variable named CVarShowDebug that directly interacts with p.animdynamics.showdebug. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable is only effective when the ENABLE_ANIM_DRAW_DEBUG macro is defined. This suggests that the debug drawing functionality might be conditionally compiled, possibly only available in development or debug builds.
Best practices when using this variable include:
- Use it only for debugging purposes, as it may impact performance.
- Be aware that it works in conjunction with another console variable, p.animdynamics.debugbone, which filters the debug drawing to a specific bone.
- Remember to disable it (set to 0) when not needed to avoid unnecessary performance overhead.
Regarding the associated variable CVarShowDebug:
- Its purpose is the same as p.animdynamics.showdebug, to enable or disable the drawing of animation dynamics data.
- It is used within the AnimGraphRuntime module, specifically in the FAnimNode_AnimDynamics class.
- Its value is set and accessed using the GetValueOnAnyThread() method, which suggests it can be accessed from multiple threads.
- It interacts directly with p.animdynamics.showdebug and CVarDebugBone.
- Developers should be aware that this variable is used in conditional statements to determine whether to perform debug drawing or certain pre-update operations.
- Best practices include using it in conjunction with CVarDebugBone for more targeted debugging and ensuring it’s properly managed in multi-threaded environments.
#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:63
Scope: file
Source code excerpt:
#if ENABLE_ANIM_DRAW_DEBUG
TAutoConsoleVariable<int32> CVarShowDebug(TEXT("p.animdynamics.showdebug"), 0, TEXT("Enable/disable the drawing of animdynamics data."));
TAutoConsoleVariable<FString> CVarDebugBone(TEXT("p.animdynamics.debugbone"), FString(), TEXT("Filters p.animdynamics.showdebug to a specific bone by name."));
void FAnimNode_AnimDynamics::DrawBodies(FComponentSpacePoseContext& InContext, const TArray<FAnimPhysRigidBody*>& InBodies)
{
if(CVarShowDebug.GetValueOnAnyThread() == 0)
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarShowDebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_AnimDynamics.cpp:63
Scope: file
Source code excerpt:
#if ENABLE_ANIM_DRAW_DEBUG
TAutoConsoleVariable<int32> CVarShowDebug(TEXT("p.animdynamics.showdebug"), 0, TEXT("Enable/disable the drawing of animdynamics data."));
TAutoConsoleVariable<FString> CVarDebugBone(TEXT("p.animdynamics.debugbone"), FString(), TEXT("Filters p.animdynamics.showdebug to a specific bone by name."));
void FAnimNode_AnimDynamics::DrawBodies(FComponentSpacePoseContext& InContext, const TArray<FAnimPhysRigidBody*>& InBodies)
{
if(CVarShowDebug.GetValueOnAnyThread() == 0)
{
return;
}
auto ToWorldV = [this](FComponentSpacePoseContext& InPoseContext, const FVector& SimLocation)
{
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_AnimDynamics.cpp:1035
Scope (from outer to inner):
file
function bool FAnimNode_AnimDynamics::HasPreUpdate
Source code excerpt:
return (CVarEnableWind.GetValueOnAnyThread() == 1 && (bEnableWind || bWindWasEnabled))
#if ENABLE_ANIM_DRAW_DEBUG
|| (CVarShowDebug.GetValueOnAnyThread() == 1 && !CVarDebugBone.GetValueOnAnyThread().IsEmpty())
#endif
;
}
return false;
}
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Public/BoneControllers/AnimNode_AnimDynamics.h:22
Scope: file
Source code excerpt:
#if ENABLE_ANIM_DRAW_DEBUG
extern TAutoConsoleVariable<int32> CVarShowDebug;
extern TAutoConsoleVariable<FString> CVarDebugBone;
#endif
DECLARE_CYCLE_STAT_EXTERN(TEXT("Anim Dynamics Overall"), STAT_AnimDynamicsOverall, STATGROUP_Physics, ANIMGRAPHRUNTIME_API);
DECLARE_CYCLE_STAT_EXTERN(TEXT("Anim Dynamics Wind Data Update"), STAT_AnimDynamicsWindData, STATGROUP_Physics, ANIMGRAPHRUNTIME_API);