a.DebugDrawSimpleBones
a.DebugDrawSimpleBones
#Overview
name: a.DebugDrawSimpleBones
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When drawing bones (using Show Bones), draw bones as simple lines.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of a.DebugDrawSimpleBones is to control the visual representation of bones when debugging skeletal meshes in Unreal Engine 5. It is specifically used for the animation and skeletal mesh rendering system.
This setting variable is primarily utilized by the Engine module, particularly within the skeletal mesh rendering subsystem. It’s referenced in the SkeletalMesh.cpp file, which is a core part of Unreal Engine’s skeletal animation system.
The value of this variable is set as a console variable (CVar) with an initial value of 0. It can be modified at runtime through the console or programmatically.
The associated variable CVarDebugDrawSimpleBones directly interacts with a.DebugDrawSimpleBones. They share the same value and purpose.
Developers must be aware that this variable affects the debug visualization of skeletal meshes. When enabled (set to a non-zero value), it causes bones to be drawn as simple lines instead of the default, more complex representation.
Best practices when using this variable include:
- Use it primarily for debugging purposes, not in production builds.
- Be aware that enabling this might slightly improve performance when visualizing complex skeletons, as it uses a simpler drawing method.
- Consider using it in conjunction with other skeletal debugging tools for a comprehensive view of the skeleton.
Regarding the associated variable CVarDebugDrawSimpleBones:
The purpose of CVarDebugDrawSimpleBones is identical to a.DebugDrawSimpleBones. It’s an internal representation of the console variable within the C++ code.
This variable is used directly in the Engine module, specifically in the FSkeletalMeshSceneProxy::DebugDrawSkeleton function. This function is responsible for rendering the debug visualization of the skeleton.
The value of CVarDebugDrawSimpleBones is set when a.DebugDrawSimpleBones is modified, as they are essentially the same variable.
CVarDebugDrawSimpleBones interacts with the rendering pipeline, specifically influencing how bones are drawn in debug mode.
Developers should be aware that this variable is checked on the render thread, which means changes to it will be reflected in the next frame.
Best practices for CVarDebugDrawSimpleBones include:
- Access its value using GetValueOnRenderThread() when in rendering code to ensure thread-safe access.
- Remember that changing this variable will affect all skeletal mesh debug drawings in the current game instance.
- Use it in conjunction with engine show flags (like EngineShowFlags.Bones) for more control over debug visualization.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalMesh.cpp:101
Scope: file
Source code excerpt:
DECLARE_CYCLE_STAT(TEXT("GetShadowShapes"), STAT_GetShadowShapes, STATGROUP_Anim);
TAutoConsoleVariable<int32> CVarDebugDrawSimpleBones(TEXT("a.DebugDrawSimpleBones"), 0, TEXT("When drawing bones (using Show Bones), draw bones as simple lines."));
TAutoConsoleVariable<int32> CVarDebugDrawBoneAxes(TEXT("a.DebugDrawBoneAxes"), 0, TEXT("When drawing bones (using Show Bones), draw bone axes."));
const FGuid FSkeletalMeshCustomVersion::GUID(0xD78A4A00, 0xE8584697, 0xBAA819B5, 0x487D46B4);
FCustomVersionRegistration GRegisterSkeletalMeshCustomVersion(FSkeletalMeshCustomVersion::GUID, FSkeletalMeshCustomVersion::LatestVersion, TEXT("SkeletalMeshVer"));
static TAutoConsoleVariable<int32> CVarRayTracingSkeletalMeshes(
#Associated Variable and Callsites
This variable is associated with another variable named CVarDebugDrawSimpleBones
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalMesh.cpp:101
Scope: file
Source code excerpt:
DECLARE_CYCLE_STAT(TEXT("GetShadowShapes"), STAT_GetShadowShapes, STATGROUP_Anim);
TAutoConsoleVariable<int32> CVarDebugDrawSimpleBones(TEXT("a.DebugDrawSimpleBones"), 0, TEXT("When drawing bones (using Show Bones), draw bones as simple lines."));
TAutoConsoleVariable<int32> CVarDebugDrawBoneAxes(TEXT("a.DebugDrawBoneAxes"), 0, TEXT("When drawing bones (using Show Bones), draw bone axes."));
const FGuid FSkeletalMeshCustomVersion::GUID(0xD78A4A00, 0xE8584697, 0xBAA819B5, 0x487D46B4);
FCustomVersionRegistration GRegisterSkeletalMeshCustomVersion(FSkeletalMeshCustomVersion::GUID, FSkeletalMeshCustomVersion::LatestVersion, TEXT("SkeletalMeshVer"));
static TAutoConsoleVariable<int32> CVarRayTracingSkeletalMeshes(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalMesh.cpp:7261
Scope (from outer to inner):
file
function void FSkeletalMeshSceneProxy::DebugDrawSkeleton
Source code excerpt:
if(EngineShowFlags.Bones || bDrawDebugSkeleton)
{
if(CVarDebugDrawSimpleBones.GetValueOnRenderThread() != 0)
{
PDI->DrawLine(Start, End, LineColor, SDPG_Foreground, 0.0f, 1.0f);
}
else
{
SkeletalDebugRendering::DrawWireBone(PDI, Start, End, LineColor, SDPG_Foreground);