a.AnimNode.FootPlacement.Enable

a.AnimNode.FootPlacement.Enable

#Overview

name: a.AnimNode.FootPlacement.Enable

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.AnimNode.FootPlacement.Enable is to control the activation of the Foot Placement feature in Unreal Engine’s animation system. This setting variable is used to enable or disable the foot placement functionality at runtime.

This setting variable is primarily used by the Animation Warping plugin, specifically within the Foot Placement module. It is referenced in the AnimNode_FootPlacement.cpp file, which is part of the AnimationWarping plugin’s runtime implementation.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of true, meaning foot placement is enabled by default. Developers can modify this value at runtime using console commands or through code.

The associated variable CVarAnimNodeFootPlacementEnable directly interacts with a.AnimNode.FootPlacement.Enable. They share the same value and purpose, with CVarAnimNodeFootPlacementEnable being the actual TAutoConsoleVariable object that manages the setting.

Developers must be aware that this variable is only effective when the ENABLE_FOOTPLACEMENT_DEBUG macro is defined. This suggests that the foot placement feature might be tied to debug functionality, and its behavior could differ in release builds.

Best practices when using this variable include:

  1. Use it for debugging and testing foot placement behavior during development.
  2. Be cautious when modifying its value in production builds, as it may affect performance or visual quality.
  3. Consider exposing this setting through a user-friendly interface for easier toggling during development or testing.

Regarding the associated variable CVarAnimNodeFootPlacementEnable:

The purpose of CVarAnimNodeFootPlacementEnable is to provide a programmatic interface for controlling the foot placement feature. It is the actual console variable object that manages the a.AnimNode.FootPlacement.Enable setting.

This variable is used within the AnimationWarping plugin, specifically in the FootPlacement module. It is checked in the IsValidToEvaluate function of the FAnimNode_FootPlacement class to determine whether foot placement should be processed.

The value of CVarAnimNodeFootPlacementEnable is set when the console variable is initialized, but it can be changed at runtime through console commands or code.

CVarAnimNodeFootPlacementEnable directly interacts with a.AnimNode.FootPlacement.Enable, as they represent the same setting. Other related variables in the same scope (like CVarAnimNodeFootPlacementEnableLock and CVarAnimNodeFootPlacementDebug) work alongside it to control various aspects of foot placement and debugging.

Developers should be aware that accessing this variable’s value should be done using the GetValueOnAnyThread() method, as shown in the IsValidToEvaluate function. This ensures thread-safe access to the variable’s current value.

Best practices for using CVarAnimNodeFootPlacementEnable include:

  1. Use it to programmatically control foot placement in different scenarios or game states.
  2. Consider caching its value if checked frequently to avoid potential performance overhead from repeated console variable lookups.
  3. Combine it with other debug variables (like CVarAnimNodeFootPlacementDebug) for comprehensive control over foot placement behavior and visualization during development.

#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:15

Scope: file

Source code excerpt:


#if ENABLE_FOOTPLACEMENT_DEBUG
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

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:


#if ENABLE_FOOTPLACEMENT_DEBUG
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

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

Scope (from outer to inner):

file
function     bool FAnimNode_FootPlacement::IsValidToEvaluate

Source code excerpt:

{
#if ENABLE_FOOTPLACEMENT_DEBUG
	if (!CVarAnimNodeFootPlacementEnable.GetValueOnAnyThread())
	{
		return false;
	}
#endif

	for (const UE::Anim::FootPlacement::FLegRuntimeData& LegData : LegsData)