UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimTrace.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_7
6#include "CoreMinimal.h"
7#include "CoreTypes.h"
8#include "ObjectTrace.h"
9#endif // UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_7
10
11#include "ObjectTraceDefines.h"
12
13#define ANIM_TRACE_ENABLED (OBJECT_TRACE_ENABLED && !(UE_BUILD_SHIPPING || UE_BUILD_TEST))
14
15#if ANIM_TRACE_ENABLED
16
18#include "BoneIndices.h"
19#include "Math/Color.h"
20#include "Math/Vector.h"
21
23
25class UAnimInstance;
27class USkeletalMesh;
28class USkeletalMeshComponent;
36struct FAnimNotifyEvent;
37struct FAnimSyncMarker;
38struct FAnimTickRecord;
41struct FPassedMarker;
42struct FPoseContext;
43
45
46struct FAnimTrace
47{
49 enum class EPhase : uint8
50 {
51 Initialize = 0,
52 PreUpdate = 1,
53 Update = 2,
54 CacheBones = 3,
55 Evaluate = 4,
56 };
57
59 enum class ENotifyEventType : uint8
60 {
61 Event = 0,
62 Begin = 1,
63 End = 2,
64 Tick = 3,
65 SyncMarker = 4 // We 'fake' sync markers with a notify type for convenience
66 };
67
68 enum class EInertializationType : uint8
69 {
71 DeadBlending = 1
72 };
73
76 {
82
84
86 };
87
90 {
96
98
99 uint64 StartCycle;
101 EPhase Phase;
102 };
103
106 {
109 };
110
112 struct FDebugLine
113 {
114 FDebugLine(const FVector& InStartLocation, const FVector& InEndLocation, const FColor& InColor, bool bInPersistentLines = false, float InLifeTime = -1.0f, float InThickness = 0.0f)
115 : StartLocation(InStartLocation)
116 , EndLocation(InEndLocation)
117 , Color(InColor)
118 , LifeTime(InLifeTime)
119 , Thickness(InThickness)
120 , bPersistentLines(bInPersistentLines)
121 {}
122
123 FVector StartLocation;
124 FVector EndLocation;
126 float LifeTime;
127 float Thickness;
128 bool bPersistentLines;
129 };
130
132 ENGINE_API static void Reset();
133
136
139
141 ENGINE_API FORCENOINLINE static void OutputSkeletalMeshComponent(const USkeletalMeshComponent* InComponent);
142
144 ENGINE_API FORCENOINLINE static void OutputSkeletalMeshFrame(const USkeletalMeshComponent* InComponent);
145
148
152
155
157 template<typename ContextType>
159 {
160 if(InContext.CustomAttributes.ContainsData())
161 {
163 }
164
165 if(InContext.Curve.Num() > 0)
166 {
168 }
169 }
170
183
186
191 ENGINE_API static uint32 OutputName(const FName& InName);
192
195
198
201
204
207
209 ENGINE_API static void OutputPoseWatch(const FAnimInstanceProxy& InSourceProxy, UPoseWatchPoseElement* InPoseWatchElement, int32 InPoseWatchId, const TArray<FTransform>& BoneTransforms, const FBlendedHeapCurve& InCurves, const TArray<FBoneIndexType>& RequiredBones, const FTransform& WorldTransform, const bool bIsEnabled);
210
213};
214
215#define TRACE_ANIM_TICK_RECORD(Context, TickRecord) \
216 FAnimTrace::OutputAnimTickRecord(Context, TickRecord);
217
218#define TRACE_SKELETAL_MESH(Mesh) \
219 FAnimTrace::OutputSkeletalMesh(Mesh);
220
221#define TRACE_SKELETAL_MESH_COMPONENT(Component) \
222 FAnimTrace::OutputSkeletalMeshComponent(Component);
223
224#define TRACE_SKELETALMESH_FRAME(Component) \
225 FAnimTrace::OutputSkeletalMeshFrame(Component);
226
227#define TRACE_SCOPED_ANIM_GRAPH(Context) \
228 FAnimTrace::FScopedAnimGraphTrace _ScopedAnimGraphTrace(Context);
229
230#define TRACE_SCOPED_ANIM_NODE(Context) \
231 FAnimTrace::FScopedAnimNodeTrace _ScopedAnimNodeTrace(Context);
232
233#define TRACE_ANIM_NODE_ATTRIBUTE(TargetProxy, SourceProxy, TargetNodeId, SourceNodeId, Name) \
234 FAnimTrace::OutputAnimNodeAttribute(TargetProxy, SourceProxy, TargetNodeId, SourceNodeId, Name);
235
236#define TRACE_ANIM_NODE_BLENDABLE_ATTRIBUTES(Context, TargetNodeId, SourceNodeId) \
237 FAnimTrace::OutputAnimNodeBlendableAttributes(Context, TargetNodeId, SourceNodeId);
238
239#define TRACE_SCOPED_ANIM_NODE_SUSPEND \
240 FAnimTrace::FScopedAnimNodeTraceSuspend _ScopedAnimNodeTraceSuspend;
241
242#define TRACE_ANIM_NODE_VALUE(Context, Key, Value) \
243 FAnimTrace::OutputAnimNodeValue(Context, Context.GetCurrentNodeId(), Key, Value);
244
245#define TRACE_ANIM_NODE_VALUE_WITH_ID(Context, NodeId, Key, Value) \
246 FAnimTrace::OutputAnimNodeValue(Context, NodeId, Key, Value);
247
248#define TRACE_ANIM_NODE_VALUE_WITH_ID_ANIM_NODE(Context, NodeId, Key, Value, ValueAnimInstanceId) \
249 FAnimTrace::OutputAnimNodeValueAnimNode(Context, NodeId, Key, Value, ValueAnimInstanceId);
250
251#define TRACE_ANIM_SEQUENCE_PLAYER(Context, Node) \
252 FAnimTrace::OutputAnimSequencePlayer(Context, Node);
253
254#define TRACE_ANIM_STATE_MACHINE_STATE(Context, StateMachineIndex, StateIndex, StateWeight, ElapsedTime) \
255 FAnimTrace::OutputStateMachineState(Context, StateMachineIndex, StateIndex, StateWeight, ElapsedTime);
256
257#define TRACE_ANIM_NOTIFY(AnimInstance, NotifyEvent, EventType) \
258 FAnimTrace::OutputAnimNotify(AnimInstance, NotifyEvent, FAnimTrace::ENotifyEventType::EventType);
259
260#define TRACE_ANIM_SYNC_MARKER(AnimInstance, SyncMarker) \
261 FAnimTrace::OutputAnimSyncMarker(AnimInstance, SyncMarker);
262
263#define TRACE_ANIM_MONTAGE(AnimInstance, MontageInstance) \
264 FAnimTrace::OutputMontage(AnimInstance, MontageInstance);
265
266#define TRACE_ANIM_NODE_SYNC(SourceProxy, SourceNodeId, GroupName) \
267 FAnimTrace::OutputSync(SourceProxy, SourceNodeId, GroupName);
268
269#define TRACE_ANIM_POSE_WATCH(SourceProxy, PoseWatchElement, PoseWatchId, BoneTransforms, Curves, RequiredBones, WorldTransform, bIsEnabled) \
270 FAnimTrace::OutputPoseWatch(SourceProxy, PoseWatchElement, PoseWatchId, BoneTransforms, Curves, RequiredBones, WorldTransform, bIsEnabled);
271
272#define TRACE_ANIM_INERTIALIZATION(SourceProxy, NodeId, Weight, Type) \
273 FAnimTrace::OutputInertialization(SourceProxy, NodeId, Weight, Type);
274
275#else
276
277#define TRACE_ANIM_TICK_RECORD(Context, TickRecord)
278#define TRACE_SKELETAL_MESH(Mesh)
279#define TRACE_SKELETAL_MESH_COMPONENT(Component)
280#define TRACE_SKELETALMESH_FRAME(Component)
281#define TRACE_SCOPED_ANIM_GRAPH(Context)
282#define TRACE_SCOPED_ANIM_NODE(Context)
283#define TRACE_ANIM_NODE_ATTRIBUTE(TargetProxy, SourceProxy, TargetNodeId, SourceNodeId, Name)
284#define TRACE_ANIM_NODE_BLENDABLE_ATTRIBUTES(Context, TargetNodeId, SourceNodeId)
285#define TRACE_SCOPED_ANIM_NODE_SUSPEND
286#define TRACE_ANIM_NODE_VALUE(Context, Key, Value)
287#define TRACE_ANIM_NODE_VALUE_WITH_ID(Context, NodeId, Key, Value)
288#define TRACE_ANIM_NODE_VALUE_WITH_ID_ANIM_NODE(Context, NodeId, Key, Value, ValueAnimInstanceId)
289#define TRACE_ANIM_SEQUENCE_PLAYER(Context, Node)
290#define TRACE_ANIM_STATE_MACHINE_STATE(Context, StateMachineIndex, StateIndex, StateWeight, ElapsedTime)
291#define TRACE_ANIM_NOTIFY(AnimInstance, NotifyEvent, EventType)
292#define TRACE_ANIM_SYNC_MARKER(AnimInstance, SyncMarker)
293#define TRACE_ANIM_MONTAGE(AnimInstance, MontageInstance)
294#define TRACE_ANIM_NODE_SYNC(SourceProxy, SourceNodeId, GroupName)
295#define TRACE_ANIM_POSE_WATCH(SourceProxy, PoseWatchElement, PoseWatchId, BoneTransforms, Curves, RequiredBones, WorldTransform, bIsEnabled)
296#define TRACE_ANIM_INERTIALIZATION(SourceProxy, NodeId, Weight, Type)
297
298#endif
#define FORCENOINLINE
Definition AndroidPlatform.h:142
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_TRACE_CHANNEL_EXTERN(ChannelName,...)
Definition Trace.h:448
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition IConsoleManager.h:1471
Definition NameTypes.h:617
Definition Array.h:670
Definition AnimInstance.h:353
Definition Class.h:3793
Definition Object.h:95
Definition PoseWatch.h:230
Definition SkeletalMesh.h:440
@ SyncMarker
Definition MirrorDataTable.h:19
Definition AnimInstanceProxy.h:144
Definition AnimMontage.h:335
Definition AnimNode_SequencePlayer.h:16
Definition AnimTypes.h:277
Definition AnimTypes.h:482
Definition AnimationAsset.h:411
Definition AnimNodeBase.h:159
Definition AnimNodeBase.h:337
Definition AnimNodeBase.h:324
Definition AnimNodeBase.h:354
Definition AnimCurveTypes.h:1049
Definition Color.h:486
Definition AnimNodeBase.h:600
Definition AnimationAsset.h:400
Definition AnimNodeBase.h:479
static ENGINE_API const FName Attributes
Definition AnimAttributes.h:19
static ENGINE_API const FName Curves
Definition AnimAttributes.h:18