a.AnimNode.SlopeWarping.Enable

a.AnimNode.SlopeWarping.Enable

#Overview

name: a.AnimNode.SlopeWarping.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.SlopeWarping.Enable is to toggle the Slope Warping feature in Unreal Engine’s animation system. This setting variable is used to control whether the Slope Warping functionality is active or not.

This setting variable is primarily used by the Animation Warping plugin, specifically within the Slope Warping module. Based on the callsites, it’s part of the animation system and is used in the AnimNode_SlopeWarping class.

The value of this variable is set through a console variable (CVarSlopeWarpingEnable) with a default value of 1 (enabled). It can be changed at runtime through console commands or programmatically.

The associated variable CVarSlopeWarpingEnable directly interacts with a.AnimNode.SlopeWarping.Enable. They share the same value and purpose.

Developers must be aware that this variable affects the evaluation of the Slope Warping node. When disabled (set to 0), the Slope Warping calculations will be skipped, which could affect character animations on sloped surfaces.

Best practices when using this variable include:

  1. Use it for debugging or performance optimization purposes.
  2. Be cautious when disabling it in a production environment, as it may affect the quality of character animations on slopes.
  3. Consider exposing this setting in the game’s options menu if you want to give players control over this feature.

Regarding the associated variable CVarSlopeWarpingEnable:

When working with CVarSlopeWarpingEnable, developers should:

  1. Use it in performance-critical sections to quickly enable/disable Slope Warping without recompiling code.
  2. Be aware that changes to this variable will affect all instances of Slope Warping in the game.
  3. Consider adding logging or analytics when this value changes to track its usage and impact on performance or gameplay.

#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_SlopeWarping.cpp:15

Scope: file

Source code excerpt:

#endif

TAutoConsoleVariable<int32> CVarSlopeWarpingEnable(TEXT("a.AnimNode.SlopeWarping.Enable"), 1, TEXT("Toggle Slope Warping"));

DECLARE_CYCLE_STAT(TEXT("Slope Warping Eval"), STAT_SlopeWarping_Eval, STATGROUP_Anim);

FAnimNode_SlopeWarping::FAnimNode_SlopeWarping()
	: MySkelMeshComponent(nullptr)
	, MyMovementComponent(nullptr)

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

#endif

TAutoConsoleVariable<int32> CVarSlopeWarpingEnable(TEXT("a.AnimNode.SlopeWarping.Enable"), 1, TEXT("Toggle Slope Warping"));

DECLARE_CYCLE_STAT(TEXT("Slope Warping Eval"), STAT_SlopeWarping_Eval, STATGROUP_Anim);

FAnimNode_SlopeWarping::FAnimNode_SlopeWarping()
	: MySkelMeshComponent(nullptr)
	, MyMovementComponent(nullptr)

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

Scope (from outer to inner):

file
function     bool FAnimNode_SlopeWarping::IsValidToEvaluate

Source code excerpt:

bool FAnimNode_SlopeWarping::IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones)
{
	const bool bIsEnabled = (CVarSlopeWarpingEnable.GetValueOnAnyThread() == 1);
	return MyMovementComponent && bIsEnabled && (IKFootRootBone.GetCompactPoseIndex(RequiredBones) != INDEX_NONE) && (PelvisBone.GetCompactPoseIndex(RequiredBones) != INDEX_NONE) && (FeetData.Num() > 0);
}

static FCompactPoseBoneIndex FindHipBoneIndex(const FCompactPoseBoneIndex& InFootBoneIndex, const int32& NumBonesInLimb, const FBoneContainer& RequiredBones)
{
	FCompactPoseBoneIndex BoneIndex = InFootBoneIndex;