a.AnimNode.FootPlacement.Enable.Lock

a.AnimNode.FootPlacement.Enable.Lock

#Overview

name: a.AnimNode.FootPlacement.Enable.Lock

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.Lock is to enable or disable foot locking in the Unreal Engine 5 animation system, specifically within the Foot Placement feature of the AnimationWarping plugin.

This setting variable is primarily used by the AnimationWarping plugin, which is part of Unreal Engine’s animation system. It’s specifically utilized in the Foot Placement functionality, which helps to improve the realism of character animations by adjusting foot positions relative to the ground.

The value of this variable is set through the Unreal Engine console system. It’s defined as a TAutoConsoleVariable, which means it can be changed at runtime through console commands.

The associated variable CVarAnimNodeFootPlacementEnableLock interacts directly with this setting. They share the same value and purpose, with CVarAnimNodeFootPlacementEnableLock being the C++ representation of the console variable.

Developers must be aware that this variable is only active when ENABLE_FOOTPLACEMENT_DEBUG is defined. This suggests it’s primarily intended for debugging and development purposes rather than production use.

When using this variable, best practices include:

  1. Only enabling it during development and debugging phases.
  2. Ensuring it’s disabled in production builds to avoid any potential performance impact.
  3. Using it in conjunction with other foot placement debug variables for comprehensive debugging.

Regarding the associated variable CVarAnimNodeFootPlacementEnableLock:

Its purpose is identical to a.AnimNode.FootPlacement.Enable.Lock - to control foot locking in the Foot Placement system.

It’s used within the AnimationWarping plugin, specifically in the FAnimNode_FootPlacement class.

The value is set when the console variable is initialized and can be changed at runtime through console commands.

It interacts directly with the WantsToPlant function in the FAnimNode_FootPlacement class, determining whether foot locking should be applied.

Developers should be aware that this variable is checked in performance-critical animation code, so frequent changes or inappropriate use could impact performance.

Best practices for using CVarAnimNodeFootPlacementEnableLock include:

  1. Use it for debugging and testing foot locking behavior.
  2. Be cautious about disabling it in production as it may affect the quality of foot placement animations.
  3. Consider the performance implications when frequently accessing or changing this value in tight loops.

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

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 CVarAnimNodeFootPlacementEnableLock. They share the same value. See the following C++ source code.

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

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:695

Scope (from outer to inner):

file
function     bool FAnimNode_FootPlacement::WantsToPlant

Source code excerpt:

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

	if ((PlantSettings.LockType == EFootPlacementLockType::Unlocked) || FMath::IsNearlyZero(LegInputPose.LockAlpha))