a.DebugDrawBoneAxes

a.DebugDrawBoneAxes

#Overview

name: a.DebugDrawBoneAxes

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of a.DebugDrawBoneAxes is to enable the drawing of bone axes when visualizing skeletal meshes in Unreal Engine 5. This setting is primarily used for debugging and development purposes within the animation and skeletal mesh systems.

This setting variable is primarily used in the Engine module, specifically within the skeletal mesh rendering subsystem. Based on the callsites, it’s evident that this variable is utilized in the SkeletalMesh.cpp file, which is a core component 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 CVarDebugDrawBoneAxes interacts directly with a.DebugDrawBoneAxes, as they share the same value and purpose. This variable is used in the actual implementation to check the current state of the debug drawing setting.

Developers should be aware that this variable is intended for debugging purposes and should not be relied upon for gameplay or production features. Enabling this setting may have performance implications, especially in scenes with many complex skeletal meshes.

Best practices when using this variable include:

  1. Only enabling it when necessary for debugging or development.
  2. Disabling it before building final release versions of the game.
  3. Being mindful of potential performance impact when enabled.
  4. Using it in conjunction with other debugging tools to get a comprehensive view of skeletal mesh behavior.

Regarding the associated variable CVarDebugDrawBoneAxes:

The purpose of CVarDebugDrawBoneAxes is to serve as the actual implementation variable for the a.DebugDrawBoneAxes setting. It is used within the engine code to determine whether bone axes should be drawn.

This variable is used in the Engine module, specifically in the skeletal mesh rendering system. It’s checked in the FSkeletalMeshSceneProxy::DebugDrawSkeleton function to determine if bone axes should be rendered.

The value of CVarDebugDrawBoneAxes is set and modified through the console variable system, mirroring the value of a.DebugDrawBoneAxes.

CVarDebugDrawBoneAxes interacts directly with a.DebugDrawBoneAxes, as they represent the same setting. It’s also used in conjunction with other debugging variables like CVarDebugDrawSimpleBones for comprehensive skeletal mesh visualization.

Developers should be aware that this variable is accessed on the render thread, which means changes to it will affect rendering in real-time.

Best practices for using CVarDebugDrawBoneAxes include:

  1. Accessing it through the GetValueOnRenderThread() method when used in rendering code.
  2. Considering its performance impact when enabled in scenes with many skeletal meshes.
  3. Using it in combination with other debugging tools for a complete understanding of skeletal mesh behavior.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalMesh.cpp:102

Scope: file

Source code excerpt:


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(
	TEXT("r.RayTracing.Geometry.SkeletalMeshes"),

#Associated Variable and Callsites

This variable is associated with another variable named CVarDebugDrawBoneAxes. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalMesh.cpp:102

Scope: file

Source code excerpt:


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(
	TEXT("r.RayTracing.Geometry.SkeletalMeshes"),

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalMesh.cpp:7270

Scope (from outer to inner):

file
function     void FSkeletalMeshSceneProxy::DebugDrawSkeleton

Source code excerpt:

			}

			if(CVarDebugDrawBoneAxes.GetValueOnRenderThread() != 0)
			{
				SkeletalDebugRendering::DrawAxes(PDI, Transform, SDPG_Foreground);
			}
		}
	}
#endif