a.ContextualAnim.IK.Debug
a.ContextualAnim.IK.Debug
#Overview
name: a.ContextualAnim.IK.Debug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Draw Debug IK Targets
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of a.ContextualAnim.IK.Debug is to enable debug drawing of IK (Inverse Kinematics) targets in the Contextual Animation system. This setting variable is primarily used for debugging and visualization purposes in the animation system of Unreal Engine 5.
This setting variable is relied upon by the Contextual Animation plugin, specifically within the ContextualAnimSceneActorComponent. It is part of the experimental Animation module in Unreal Engine 5.
The value of this variable is set as a console variable (CVar) with an initial value of 0, which means the debug drawing is disabled by default. It can be changed at runtime through the console or programmatically.
The associated variable CVarContextualAnimIKDebug interacts directly with a.ContextualAnim.IK.Debug. They share the same value and purpose. Additionally, there’s another related variable, CVarContextualAnimIKDrawDebugLifetime, which controls the duration of the debug drawing.
Developers must be aware that this debug feature is only available in non-shipping and non-test builds of the game. It’s wrapped in a preprocessor conditional (#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)).
Best practices when using this variable include:
- Only enable it when necessary for debugging IK issues.
- Remember to disable it in production builds to avoid performance overhead.
- Use in conjunction with CVarContextualAnimIKDrawDebugLifetime to control the visibility duration of debug lines.
Regarding the associated variable CVarContextualAnimIKDebug:
- Its purpose is the same as a.ContextualAnim.IK.Debug - to control the debug drawing of IK targets.
- It’s used directly in the code to check if debug drawing should be performed.
- Its value is retrieved using GetValueOnGameThread() method, indicating it’s designed for runtime configuration.
- When enabled (value > 0), it triggers the drawing of debug lines and coordinate systems to visualize IK targets.
- Developers should use this variable in conjunction with CVarContextualAnimIKDrawDebugLifetime to fine-tune their debugging process.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/Animation/ContextualAnimation/Source/ContextualAnimation/Private/ContextualAnimSceneActorComponent.cpp:25
Scope: file
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
TAutoConsoleVariable<int32> CVarContextualAnimIKDebug(TEXT("a.ContextualAnim.IK.Debug"), 0, TEXT("Draw Debug IK Targets"));
TAutoConsoleVariable<float> CVarContextualAnimIKDrawDebugLifetime(TEXT("a.ContextualAnim.IK.DrawDebugLifetime"), 0, TEXT("Draw Debug Duration"));
#endif
void FContextualAnimRepData::IncrementRepCounter()
{
static uint8 Counter = 0;
#Associated Variable and Callsites
This variable is associated with another variable named CVarContextualAnimIKDebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/Animation/ContextualAnimation/Source/ContextualAnimation/Private/ContextualAnimSceneActorComponent.cpp:25
Scope: file
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
TAutoConsoleVariable<int32> CVarContextualAnimIKDebug(TEXT("a.ContextualAnim.IK.Debug"), 0, TEXT("Draw Debug IK Targets"));
TAutoConsoleVariable<float> CVarContextualAnimIKDrawDebugLifetime(TEXT("a.ContextualAnim.IK.DrawDebugLifetime"), 0, TEXT("Draw Debug Duration"));
#endif
void FContextualAnimRepData::IncrementRepCounter()
{
static uint8 Counter = 0;
#Loc: <Workspace>/Engine/Plugins/Experimental/Animation/ContextualAnimation/Source/ContextualAnimation/Private/ContextualAnimSceneActorComponent.cpp:1209
Scope (from outer to inner):
file
function void UContextualAnimSceneActorComponent::UpdateIKTargets
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (CVarContextualAnimIKDebug.GetValueOnGameThread() > 0)
{
const float DrawDebugDuration = CVarContextualAnimIKDrawDebugLifetime.GetValueOnGameThread();
DrawDebugLine(GetWorld(), IKTargetParentTransform.GetLocation(), IKTargetTransform.GetLocation(), FColor::MakeRedToGreenColorFromScalar(Alpha), false, DrawDebugDuration, 0, 0.5f);
DrawDebugCoordinateSystem(GetWorld(), IKTargetTransform.GetLocation(), IKTargetTransform.Rotator(), 10.f, false, DrawDebugDuration, 0, 0.5f);
}
#endif
#Loc: <Workspace>/Engine/Plugins/Experimental/Animation/ContextualAnimation/Source/ContextualAnimation/Private/ContextualAnimSceneActorComponent.cpp:1224
Scope (from outer to inner):
file
function void UContextualAnimSceneActorComponent::UpdateIKTargets
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (CVarContextualAnimIKDebug.GetValueOnGameThread() > 0)
{
const float DrawDebugDuration = CVarContextualAnimIKDrawDebugLifetime.GetValueOnGameThread();
const FTransform IKTargetParentTransform = TargetSkelMeshComp->GetSocketTransform(TargetSkelMeshComp->GetParentBone(IKTargetDef.TargetBoneName));
DrawDebugLine(GetWorld(), IKTargetParentTransform.GetLocation(), IKTargetTransform.GetLocation(), FColor::MakeRedToGreenColorFromScalar(Alpha), false, DrawDebugDuration, 0, 0.5f);
DrawDebugCoordinateSystem(GetWorld(), IKTargetTransform.GetLocation(), IKTargetTransform.Rotator(), 10.f, false, DrawDebugDuration, 0, 0.5f);
}