a.AnimNode.FootPlacement.Debug

a.AnimNode.FootPlacement.Debug

#Overview

name: a.AnimNode.FootPlacement.Debug

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

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of a.AnimNode.FootPlacement.Debug is to enable visualization debugging for the Foot Placement system in Unreal Engine 5. This setting variable is primarily used for the animation system, specifically for foot placement and debugging purposes.

This setting variable is used in the Animation Warping plugin, which is part of Unreal Engine’s animation system. It is referenced in the AnimNode_FootPlacement.cpp file, which suggests it’s closely tied to the foot placement functionality.

The value of this variable is set as a console variable (CVar) with a default value of false. It can be toggled on or off during runtime or development.

The associated variable CVarAnimNodeFootPlacementDebug interacts directly with a.AnimNode.FootPlacement.Debug. They share the same value and are used interchangeably in the code.

Developers should be aware that:

  1. This variable is for debugging purposes and should be used during development or troubleshooting, not in production builds.
  2. Enabling this debug option may impact performance, so it should be used judiciously.
  3. It works in conjunction with other debug variables like CVarAnimNodeFootPlacementDebugTraces and CVarAnimNodeFootPlacementDebugDrawHistory for more comprehensive debugging.

Best practices when using this variable include:

  1. Use it temporarily during development to visualize and understand foot placement behavior.
  2. Combine it with other debug options for a more complete picture of the foot placement system.
  3. Remember to disable it before creating production builds to avoid unnecessary performance overhead.

Regarding the associated variable CVarAnimNodeFootPlacementDebug:

#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_FootPlacement.cpp:17

Scope: file

Source code excerpt:

static TAutoConsoleVariable<bool> CVarAnimNodeFootPlacementEnable(TEXT("a.AnimNode.FootPlacement.Enable"), true, TEXT("Enable/Disable Foot Placement"));
static TAutoConsoleVariable<bool> CVarAnimNodeFootPlacementEnableLock(TEXT("a.AnimNode.FootPlacement.Enable.Lock"), true, TEXT("Enable/Disable Foot Locking"));
static TAutoConsoleVariable<bool> CVarAnimNodeFootPlacementDebug(TEXT("a.AnimNode.FootPlacement.Debug"), false, TEXT("Turn on visualization debugging for Foot Placement"));
static TAutoConsoleVariable<bool> CVarAnimNodeFootPlacementDebugTraces(TEXT("a.AnimNode.FootPlacement.Debug.Traces"), false, TEXT("Turn on visualization debugging for foot ground traces"));
static TAutoConsoleVariable<int> CVarAnimNodeFootPlacementDebugDrawHistory(TEXT("a.AnimNode.FootPlacement.Debug.DrawHistory"), 0,
	TEXT("Turn on history visualization debugging 0 = Disabled, -1 = Pelvis, >1 = Foot Index. Clear with FlushPersistentDebugLines"));
#endif

namespace UE::Anim::FootPlacement

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/AnimationWarping/Source/Runtime/Private/BoneControllers/AnimNode_FootPlacement.cpp:17

Scope: file

Source code excerpt:

static TAutoConsoleVariable<bool> CVarAnimNodeFootPlacementEnable(TEXT("a.AnimNode.FootPlacement.Enable"), true, TEXT("Enable/Disable Foot Placement"));
static TAutoConsoleVariable<bool> CVarAnimNodeFootPlacementEnableLock(TEXT("a.AnimNode.FootPlacement.Enable.Lock"), true, TEXT("Enable/Disable Foot Locking"));
static TAutoConsoleVariable<bool> CVarAnimNodeFootPlacementDebug(TEXT("a.AnimNode.FootPlacement.Debug"), false, TEXT("Turn on visualization debugging for Foot Placement"));
static TAutoConsoleVariable<bool> CVarAnimNodeFootPlacementDebugTraces(TEXT("a.AnimNode.FootPlacement.Debug.Traces"), false, TEXT("Turn on visualization debugging for foot ground traces"));
static TAutoConsoleVariable<int> CVarAnimNodeFootPlacementDebugDrawHistory(TEXT("a.AnimNode.FootPlacement.Debug.DrawHistory"), 0,
	TEXT("Turn on history visualization debugging 0 = Disabled, -1 = Pelvis, >1 = Foot Index. Clear with FlushPersistentDebugLines"));
#endif

namespace UE::Anim::FootPlacement

#Loc: <Workspace>/Engine/Plugins/Animation/AnimationWarping/Source/Runtime/Private/BoneControllers/AnimNode_FootPlacement.cpp:1207

Scope (from outer to inner):

file
function     void FAnimNode_FootPlacement::EvaluateSkeletalControl_AnyThread

Source code excerpt:

#if ENABLE_FOOTPLACEMENT_DEBUG
	const FTransform PelvisTargetTransformCS = PelvisTransformCS;
	if (CVarAnimNodeFootPlacementDebug.GetValueOnAnyThread())
	{
		// Debug text header
		FString HeaderMessage = FString::Printf(TEXT("FOOT PLACEMENT DEBUG"));
		FootPlacementContext.CSPContext.AnimInstanceProxy->AnimDrawDebugOnScreenMessage(HeaderMessage, FColor::Cyan);
	}
#endif

#Loc: <Workspace>/Engine/Plugins/Animation/AnimationWarping/Source/Runtime/Private/BoneControllers/AnimNode_FootPlacement.cpp:1247

Scope (from outer to inner):

file
function     void FAnimNode_FootPlacement::EvaluateSkeletalControl_AnyThread

Source code excerpt:


#if ENABLE_FOOTPLACEMENT_DEBUG
		if (CVarAnimNodeFootPlacementDebug.GetValueOnAnyThread())
		{
			DrawDebug(FootPlacementContext, LegData, PlantResult);

			// Grab positions to debug draw history
			DebugData.OutputFootLocationsWS[FootIndex] =
				FootPlacementContext.OwningComponentToWorld.TransformPosition(PlantResult.FootTranformCS.Transform.GetLocation());

#Loc: <Workspace>/Engine/Plugins/Animation/AnimationWarping/Source/Runtime/Private/BoneControllers/AnimNode_FootPlacement.cpp:1276

Scope (from outer to inner):

file
function     void FAnimNode_FootPlacement::EvaluateSkeletalControl_AnyThread

Source code excerpt:

		DebugData.OutputPelvisLocationWS = OutputPelvisLocationWS;

		if (CVarAnimNodeFootPlacementDebug.GetValueOnAnyThread())
		{
			const int32 DrawIndex = CVarAnimNodeFootPlacementDebugDrawHistory.GetValueOnAnyThread();
			if ((DrawIndex != 0) && !bIsFirstUpdate)
			{
				if (DrawIndex == -1)
				{

#Loc: <Workspace>/Engine/Plugins/Animation/AnimationWarping/Source/Runtime/Private/BoneControllers/AnimNode_FootPlacement.cpp:1743

Scope (from outer to inner):

file
function     void FAnimNode_FootPlacement::ProcessFootAlignment

Source code excerpt:


#if ENABLE_FOOTPLACEMENT_DEBUG
		if (CVarAnimNodeFootPlacementDebug.GetValueOnAnyThread())
		{
			const FVector PlaneNormalWS = Context.OwningComponentToWorld.TransformVector(PlaneNormal);;
			const FVector PlaneCenterWS = Context.OwningComponentToWorld.TransformPosition(PlaneCenter);;
			Context.CSPContext.AnimInstanceProxy->AnimDrawDebugCircle(
				PlaneCenterWS, 25.0f, 24, FColor::Red,
				PlaneNormalWS, false, -1.0f, SDPG_Foreground, 0.5f);