a.Compiler.CachePoseNodeUpdateOrderDebug.Enable
a.Compiler.CachePoseNodeUpdateOrderDebug.Enable
#Overview
name: a.Compiler.CachePoseNodeUpdateOrderDebug.Enable
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Toggle debugging for CacheNodeUpdateOrder debug during AnimBP compilation
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of a.Compiler.CachePoseNodeUpdateOrderDebug.Enable is to toggle debugging for CacheNodeUpdateOrder during AnimBP (Animation Blueprint) compilation in Unreal Engine 5.
This setting variable is primarily used by the animation system, specifically in the AnimGraph module. It’s utilized during the compilation process of Animation Blueprints to help debug the order in which cached pose nodes are updated.
Based on the callsites, this variable is used within the UAnimBlueprintExtension_CachedPose class, which is part of the AnimGraph module in the Unreal Engine editor.
The value of this variable is set through a console variable (CVar) named CVarAnimDebugCachePoseNodeUpdateOrder. It’s initialized with a default value of 0, meaning the debugging is disabled by default.
This variable interacts closely with its associated variable CVarAnimDebugCachePoseNodeUpdateOrder. They share the same value and are used interchangeably in the code.
Developers should be aware that enabling this debug option (by setting the value to 1) will cause additional debug output during Animation Blueprint compilation. This can be useful for understanding the order in which cached pose nodes are processed, but may also impact compilation performance.
Best practices when using this variable include:
- Only enable it when debugging Animation Blueprint compilation issues related to cached poses.
- Remember to disable it after debugging to avoid unnecessary performance overhead.
- Use it in conjunction with other animation debugging tools for a comprehensive understanding of the animation system’s behavior.
Regarding the associated variable CVarAnimDebugCachePoseNodeUpdateOrder:
This is a TAutoConsoleVariable
The variable is typically accessed using GetValueOnAnyThread(), which suggests it can be safely read from multiple threads. However, changing its value at runtime might not immediately affect ongoing compilations.
Developers should use this variable cautiously and mainly for debugging purposes. It’s not intended for use in shipping builds or as a way to alter the functionality of the animation system outside of debug scenarios.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/AnimGraph/Private/AnimBlueprintExtension_CachedPose.cpp:35
Scope: file
Source code excerpt:
}
TAutoConsoleVariable<int32> CVarAnimDebugCachePoseNodeUpdateOrder(TEXT("a.Compiler.CachePoseNodeUpdateOrderDebug.Enable"), 0, TEXT("Toggle debugging for CacheNodeUpdateOrder debug during AnimBP compilation"));
void UAnimBlueprintExtension_CachedPose::BuildCachedPoseNodeUpdateOrder(IAnimBlueprintCompilationContext& InCompilationContext, IAnimBlueprintGeneratedClassCompiledData& OutCompiledData)
{
TArray<UAnimGraphNode_Root*> RootNodes;
InCompilationContext.GetConsolidatedEventGraph()->GetNodesOfClass<UAnimGraphNode_Root>(RootNodes);
#Associated Variable and Callsites
This variable is associated with another variable named CVarAnimDebugCachePoseNodeUpdateOrder
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/AnimGraph/Private/AnimBlueprintExtension_CachedPose.cpp:35
Scope: file
Source code excerpt:
}
TAutoConsoleVariable<int32> CVarAnimDebugCachePoseNodeUpdateOrder(TEXT("a.Compiler.CachePoseNodeUpdateOrderDebug.Enable"), 0, TEXT("Toggle debugging for CacheNodeUpdateOrder debug during AnimBP compilation"));
void UAnimBlueprintExtension_CachedPose::BuildCachedPoseNodeUpdateOrder(IAnimBlueprintCompilationContext& InCompilationContext, IAnimBlueprintGeneratedClassCompiledData& OutCompiledData)
{
TArray<UAnimGraphNode_Root*> RootNodes;
InCompilationContext.GetConsolidatedEventGraph()->GetNodesOfClass<UAnimGraphNode_Root>(RootNodes);
#Loc: <Workspace>/Engine/Source/Editor/AnimGraph/Private/AnimBlueprintExtension_CachedPose.cpp:48
Scope (from outer to inner):
file
function void UAnimBlueprintExtension_CachedPose::BuildCachedPoseNodeUpdateOrder
Source code excerpt:
});
const bool bEnableDebug = (CVarAnimDebugCachePoseNodeUpdateOrder.GetValueOnAnyThread() == 1);
for(UAnimGraphNode_Root* RootNode : RootNodes)
{
TArray<UAnimGraphNode_SaveCachedPose*> OrderedSavePoseNodes;
TArray<UAnimGraphNode_Base*> VisitedRootNodes;
#Loc: <Workspace>/Engine/Source/Editor/AnimGraph/Private/AnimBlueprintExtension_CachedPose.cpp:94
Scope (from outer to inner):
file
function void UAnimBlueprintExtension_CachedPose::CachePoseNodeOrdering_StartNewTraversal
Source code excerpt:
FString RootName = RootCacheNode ? RootCacheNode->CacheName : InRootNode->GetName();
const bool bEnableDebug = (CVarAnimDebugCachePoseNodeUpdateOrder.GetValueOnAnyThread() == 1);
UE_CLOG(bEnableDebug, LogAnimation, Display, TEXT("StartNewTraversal %s"), *RootName);
// Track which root nodes we've visited to prevent infinite recursion.
VisitedRootNodes.Add(InRootNode);
#Loc: <Workspace>/Engine/Source/Editor/AnimGraph/Private/AnimBlueprintExtension_CachedPose.cpp:131
Scope (from outer to inner):
file
function void UAnimBlueprintExtension_CachedPose::CachePoseNodeOrdering_TraverseInternal_SubGraph
Source code excerpt:
void UAnimBlueprintExtension_CachedPose::CachePoseNodeOrdering_TraverseInternal_SubGraph(IAnimBlueprintCompilationContext& InCompilationContext, UEdGraph* InGraph, TArray<UAnimGraphNode_SaveCachedPose*> &OrderedSavePoseNodes)
{
const bool bEnableDebug = (CVarAnimDebugCachePoseNodeUpdateOrder.GetValueOnAnyThread() == 1);
UE_CLOG(bEnableDebug, LogAnimation, Display, TEXT("ProcessGraph %s"), *InGraph->GetName());
if(InGraph->Schema->IsChildOf(UAnimationGraphSchema::StaticClass()))
{
TArray<UAnimGraphNode_Base*> PotentialRootNodes;
InGraph->GetNodesOfClass(PotentialRootNodes);
#Loc: <Workspace>/Engine/Source/Editor/AnimGraph/Private/AnimBlueprintExtension_CachedPose.cpp:161
Scope (from outer to inner):
file
function void UAnimBlueprintExtension_CachedPose::CachePoseNodeOrdering_TraverseInternal
Source code excerpt:
InCompilationContext.GetLinkedAnimNodes(InAnimGraphNode, LinkedAnimNodes);
const bool bEnableDebug = (CVarAnimDebugCachePoseNodeUpdateOrder.GetValueOnAnyThread() == 1);
for (UAnimGraphNode_Base* LinkedNode : LinkedAnimNodes)
{
UE_CLOG(bEnableDebug, LogAnimation, Display, TEXT("\t Processing %s"), *LinkedNode->GetName());
if (UAnimGraphNode_UseCachedPose* UsePoseNode = Cast<UAnimGraphNode_UseCachedPose>(LinkedNode))
{