UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimNodeBase.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "UObject/ObjectKey.h"
8#include "UObject/Class.h"
10#include "Animation/AnimTypes.h"
12#include "BonePose.h"
19#include "AnimNodeFunctionRef.h"
20
21#include "AnimNodeBase.generated.h"
22
23#define DECLARE_SCOPE_HIERARCHICAL_COUNTER_ANIMNODE(Method) \
24 DECLARE_SCOPE_HIERARCHICAL_COUNTER_FUNC()
25
26#ifndef UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER
27 #define UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER 0
28#endif
29
31class UAnimBlueprint;
32class UAnimInstance;
34struct FAnimNode_Base;
35class UProperty;
38
46{
50
52
53 template<typename NodeType>
54 static FKey GetKey()
55 {
56 return FKey(NodeType::StaticStruct());
57 }
58
59 template<typename NodeType>
60 FKey Push(NodeType* Node)
61 {
63 FNodeStack& Stack = Map.FindOrAdd(Key);
64 Stack.Push(Node);
65 return Key;
66 }
67
68 template<typename NodeType>
69 NodeType* Pop()
70 {
71 FNodeStack* Stack = Map.Find(GetKey<NodeType>());
72 return Stack ? static_cast<NodeType*>(Stack->Pop()) : nullptr;
73 }
74
76 {
77 FNodeStack* Stack = Map.Find(Key);
78 return Stack ? Stack->Pop() : nullptr;
79 }
80
81 template<typename NodeType>
82 NodeType* Top() const
83 {
84 const FNodeStack* Stack = Map.Find(GetKey<NodeType>());
85 return (Stack && Stack->Num() != 0) ? static_cast<NodeType*>(Stack->Top()) : nullptr;
86 }
87
88 void CopyTopsOnly(const FAnimNodeTracker& Source)
89 {
90 Map.Reset();
91 Map.Reserve(Source.Map.Num());
92 for (const auto& Iter : Source.Map)
93 {
94 if (Iter.Value.Num() != 0)
95 {
96 FNodeStack& Stack = Map.Add(Iter.Key);
97 Stack.Push(Iter.Value.Top());
98 }
99 }
100 }
101};
102
103
106{
107public:
109
114
116 {
117 if (Tracker && TrackedKey != FAnimNodeTracker::FKey())
118 {
119 Tracker->Pop(TrackedKey);
120 }
121 }
122
123private:
124 FAnimNodeTracker* Tracker = nullptr;
125 FAnimNodeTracker::FKey TrackedKey;
126};
127
128
131{
133
134 // Non-copyable
137
138#if !UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER
139 UE_DEPRECATED(5.0, "Please use the message & tagging system in UE::Anim::FMessageStack")
141#endif
142
143 // Message stack used for storing scoped messages and tags during execution
145
147 {
148#if !UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER
150 AncestorTracker.CopyTopsOnly(Source.AncestorTracker);
152#endif
153 MessageStack.CopyForCachedUpdate(Source.MessageStack);
154 }
155};
156
159{
160public:
162
164
166
167protected:
168 // DEPRECATED - Please use constructor that uses an FAnimInstanceProxy*
170
172
173public:
180
181public:
182 // Get the Blueprint IAnimClassInterface associated with this context, if there is one.
183 // Note: This can return NULL, so check the result.
185
186 // Get the anim instance associated with the current proxy
188
189#if WITH_EDITORONLY_DATA
190 // Get the AnimBlueprint associated with this context, if there is one.
191 // Note: This can return NULL, so check the result.
193#endif //WITH_EDITORONLY_DATA
194
195#if !UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER
196 template<typename NodeType>
197 UE_DEPRECATED(5.0, "Please use the message & tagging system in UE::Anim::FMessageStack")
198 FScopedAnimNodeTracker TrackAncestor(NodeType* Node) const {
199 if (ensure(SharedContext != nullptr))
200 {
203 }
204
205 return FScopedAnimNodeTracker();
206 }
207#endif
208
209#if !UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER
210 template<typename NodeType>
211 UE_DEPRECATED(5.0, "Please use the message & tagging system in UE::Anim::FMessageStack")
212 NodeType* GetAncestor() const {
213 if (ensure(SharedContext != nullptr))
214 {
215 FAnimNode_Base* Node = SharedContext->AncestorTracker.Top<NodeType>();
216 return static_cast<NodeType*>(Node);
217 }
218
219 return nullptr;
220 }
221#endif
222
223 // Get the innermost scoped message of the specified type
224 template<typename TGraphMessageType>
226 {
227 if (ensure(SharedContext != nullptr))
228 {
229 TGraphMessageType* Message = nullptr;
230
232 {
233 Message = &InMessage;
234 });
235
236 return Message;
237 }
238
239 return nullptr;
240 }
241
242 // Find the innermost scoped message of the specified type matching the condition of InFunction
243 template<typename TGraphMessageType>
245 {
246 if (ensure(SharedContext != nullptr))
247 {
248 TGraphMessageType* Message = nullptr;
250 {
252 {
253 Message = &InMessage;
255 }
257 });
258
259 return Message;
260 }
261
262 return nullptr;
263 }
264
265 // Get the innermost scoped message of the specified type
266 template<typename TGraphMessageType>
268 {
269 check(SharedContext != nullptr);
270
271 TGraphMessageType* Message = nullptr;
272
274 {
275 Message = &InMessage;
276 });
277
278 check(Message != nullptr);
279
280 return *Message;
281 }
282
288
290 {
291 CurrentNodeId = InContext.CurrentNodeId;
292 PreviousNodeId = InContext.PreviousNodeId;
293 }
294
295 // Get the current node Id, set when we recurse into graph traversal functions from pose links
297
298 // Get the previous node Id, set when we recurse into graph traversal functions from pose links
300
301 // Get whether the graph branch of this context is active (i.e. NOT blending out).
302 bool IsActive() const { return bIsActive; }
303
304protected:
305
306 // Whether this context belongs to graph branch (i.e. NOT blending out).
307 bool bIsActive = true;
308
309 // The current node ID, set when we recurse into graph traversal functions from pose links
311
312 // The previous node ID, set when we recurse into graph traversal functions from pose links
314
315protected:
316
319};
320
321
331
351
354{
355private:
356 float CurrentWeight;
357 float RootMotionWeightModifier;
358
359 float DeltaTime;
360
361public:
364 , CurrentWeight(1.0f)
365 , RootMotionWeightModifier(1.0f)
366 , DeltaTime(0.0f)
367 {
368 }
369
372 , CurrentWeight(1.0f)
373 , RootMotionWeightModifier(1.0f)
374 , DeltaTime(InDeltaTime)
375 {
376 }
377
378
381 , CurrentWeight(Copy.CurrentWeight)
382 , RootMotionWeightModifier(Copy.RootMotionWeightModifier)
383 , DeltaTime(Copy.DeltaTime)
384 {
386 PreviousNodeId = Copy.PreviousNodeId;
387 }
388
389public:
394
396 {
397 FAnimationUpdateContext Result(*this);
398 Result.SharedContext = InSharedContext;
399
400 // This is currently only used in the case of cached poses, where we dont want to preserve the previous node, so clear it here
401 // Result.PreviousNodeId = INDEX_NONE;
402
403 return Result;
404 }
405
407 {
408 FAnimationUpdateContext Result(*this);
409 Result.bIsActive = false;
410
411 return Result;
412 }
413
415 {
416 FAnimationUpdateContext Result(*this);
417 Result.CurrentWeight = CurrentWeight * WeightMultiplier;
418
419 return Result;
420 }
421
423 {
424 FAnimationUpdateContext Result(*this);
425 Result.CurrentWeight = CurrentWeight * WeightMultiplier;
426 Result.RootMotionWeightModifier = RootMotionWeightModifier * RootMotionMultiplier;
427
428 return Result;
429 }
430
432 {
433 FAnimationUpdateContext Result(*this);
434 Result.DeltaTime = DeltaTime * TimeMultiplier;
435 Result.CurrentWeight = CurrentWeight * WeightMultiplier;
436 return Result;
437 }
438
440 {
441 FAnimationUpdateContext Result(*this);
442 Result.DeltaTime = DeltaTime * TimeMultiplier;
443 Result.CurrentWeight = CurrentWeight * WeightMultiplier;
444 Result.RootMotionWeightModifier = RootMotionWeightModifier * RootMotionMultiplier;
445
446 return Result;
447 }
448
450 {
451 FAnimationUpdateContext Result(*this);
452 Result.SetNodeId(InNodeId);
453 return Result;
454 }
455
456 // Returns persistent state that is tracked through animation tree update
461
462 // Returns the final blend weight contribution for this stage
463 float GetFinalBlendWeight() const { return CurrentWeight; }
464
465 // Returns the weight modifier for root motion (as root motion weight wont always match blend weight)
466 float GetRootMotionWeightModifier() const { return RootMotionWeightModifier; }
467
468 // Returns the delta time for this update, in seconds
469 float GetDeltaTime() const { return DeltaTime; }
470
471 // Log update message
474};
475
476
479{
480public:
481 /* These Pose/Curve/Attributes are allocated using MemStack. You should not use it outside of stack. */
485
486public:
488
489 // This constructor allocates a new uninitialized pose for the specified anim instance
496
497 // This constructor allocates a new uninitialized pose, copying non-pose state from the source context
498 FPoseContext(const FPoseContext& SourceContext, bool bInOverrideExpectsAdditivePose = false)
500 , bExpectsAdditivePose(SourceContext.bExpectsAdditivePose || bInOverrideExpectsAdditivePose)
501 {
502 InitializeImpl(SourceContext.AnimInstanceProxy);
503
504 CurrentNodeId = SourceContext.CurrentNodeId;
505 PreviousNodeId = SourceContext.PreviousNodeId;
506 }
507
508 // This constructor allocates a new uninitialized pose, using the provided BoneContainer (when there is no AnimInstanceProxy available)
517
518 UE_DEPRECATED(5.2, "This function will be made private. It should never be called externally, use the constructor instead.")
520
521 // Log evaluation message
524
526 {
527 if (bExpectsAdditivePose)
528 {
530 }
531 else
532 {
534 }
535 }
536
541
542 bool ContainsNaN() const
543 {
544 return Pose.ContainsNaN();
545 }
546
547 bool IsNormalized() const
548 {
549 return Pose.IsNormalized();
550 }
551
553 {
554 if (AnimInstanceProxy != Other.AnimInstanceProxy)
555 {
556 InitializeImpl(AnimInstanceProxy);
557 }
558
559 Pose = Other.Pose;
560 Curve = Other.Curve;
561 CustomAttributes = Other.CustomAttributes;
562 bExpectsAdditivePose = Other.bExpectsAdditivePose;
563 return *this;
564 }
565
566 // Is this pose expected to be additive
567 bool ExpectsAdditivePose() const { return bExpectsAdditivePose; }
568
569private:
571
572 // Is this pose expected to be an additive pose
573 bool bExpectsAdditivePose;
574};
575
576// Helper for modifying and resetting ExpectsAdditivePose on a FPoseContext
578{
579public:
581 : Context(InContext)
582 {
583 bPreviousValue = Context.ExpectsAdditivePose();
584 Context.bExpectsAdditivePose = bInExpectsAdditive;
585 }
586
588 {
589 Context.bExpectsAdditivePose = bPreviousValue;
590 }
591private:
592 FPoseContext& Context;
593 bool bPreviousValue;
594};
595
596
597
600{
601public:
605
606public:
607 // This constructor allocates a new uninitialized pose for the specified anim instance
610 {
611 // No need to initialize, done through FA2CSPose::AllocateLocalPoses
612 }
613
614 // This constructor allocates a new uninitialized pose, copying non-pose state from the source context
617 {
618 // No need to initialize, done through FA2CSPose::AllocateLocalPoses
619
620 CurrentNodeId = SourceContext.CurrentNodeId;
621 PreviousNodeId = SourceContext.PreviousNodeId;
622 }
623
624 // Note: this copy assignment operator copies the whole object but the copy constructor only copies part of the object.
626
628
629 ENGINE_API bool ContainsNaN() const;
630 ENGINE_API bool IsNormalized() const;
631};
632
637#define ANIM_NODE_DEBUG_MAX_CHAIN 50
638#define ANIM_NODE_DEBUG_MAX_CHILDREN 12
639#define ANIM_NODE_DEBUG_MAX_CACHEPOSE 20
640
642{
643private:
644 struct DebugItem
645 {
646 DebugItem(FString Data, bool bInPoseSource) : DebugData(Data), bPoseSource(bInPoseSource) {}
647
649 FString DebugData;
650
652 bool bPoseSource;
653
655 TArray<FNodeDebugData> ChildNodeChain;
656 };
657
659 float AbsoluteWeight;
660
662 TArray<DebugItem> NodeChain;
663
665 FString NodeDescription;
666
668 FNodeDebugData* RootNodePtr;
669
671 TArray<FNodeDebugData> SaveCachePoseNodes;
672
673public:
685
687 : AbsoluteWeight(1.f), RootNodePtr(this), AnimInstance(InAnimInstance)
688 {
689 SaveCachePoseNodes.Reserve(ANIM_NODE_DEBUG_MAX_CACHEPOSE);
690 }
691
693 : AbsoluteWeight(AbsWeight)
694 , NodeDescription(InNodeDescription)
695 , RootNodePtr(InRootNodePtr)
697 {}
698
699 ENGINE_API void AddDebugItem(FString DebugData, bool bPoseSource = false);
702
703 template<class Type>
704 FString GetNodeName(Type* Node)
705 {
706 FString FinalString = FString::Printf(TEXT("%s<W:%.1f%%> %s"), *Node->StaticStruct()->GetName(), AbsoluteWeight*100.f, *NodeDescription);
707 NodeDescription.Empty();
708 return FinalString;
709 }
710
712
714 {
716 int32 ChainID = 0;
717 GetFlattenedDebugData(Data, 0, ChainID);
718 return Data;
719 }
720
721 // Anim instance that we are generating debug data for
723};
724
726UENUM()
728{
729 enum Type : int
730 {
732 NeverAsPin,
733
735 PinHiddenByDefault,
736
738 PinShownByDefault,
739
741 AlwaysAsPin
742 };
743}
744
745#define ENABLE_ANIMGRAPH_TRAVERSAL_DEBUG 0
746
748USTRUCT(BlueprintInternalUseOnly)
750{
752
753protected:
756
757public:
759 UPROPERTY(meta=(BlueprintCompilerGeneratedDefaults))
760 int32 LinkID;
761
762#if WITH_EDITORONLY_DATA
764 UPROPERTY(meta=(BlueprintCompilerGeneratedDefaults))
766#endif
767
768#if ENABLE_ANIMGRAPH_TRAVERSAL_DEBUG
769 FGraphTraversalCounter InitializationCounter;
770 FGraphTraversalCounter CachedBonesCounter;
771 FGraphTraversalCounter UpdateCounter;
772 FGraphTraversalCounter EvaluationCounter;
773#endif
774
775protected:
776#if DO_CHECK
778 bool bProcessed;
779#endif
780
781public:
783 : LinkedNode(nullptr)
784 , LinkID(INDEX_NONE)
787#endif
789 , bProcessed(false)
790#endif
791 {
792 }
793
794 // Interface
795
797 ENGINE_API void CacheBones(const FAnimationCacheBonesContext& Context);
799 ENGINE_API void GatherDebugData(FNodeDebugData& DebugData);
800
802 ENGINE_API void AttemptRelink(const FAnimationBaseContext& Context);
803
805 ENGINE_API void SetLinkNode(FAnimNode_Base* NewLinkNode);
806
808 ENGINE_API void SetDynamicLinkNode(struct FPoseLinkBase* InPoseLink);
809
811 ENGINE_API FAnimNode_Base* GetLinkNode();
812};
813
814#define ENABLE_ANIMNODE_POSE_DEBUG 0
815
817USTRUCT(BlueprintInternalUseOnly)
819{
821
822public:
823 // Interface
824 ENGINE_API void Evaluate(FPoseContext& Output);
825
826#if ENABLE_ANIMNODE_POSE_DEBUG
827private:
828 // forwarded pose data from the wired node which current node's skeletal control is not applied yet
830#endif //#if ENABLE_ANIMNODE_POSE_DEBUG
831};
832
834USTRUCT(BlueprintInternalUseOnly)
836{
838
839public:
840 // Interface
841 ENGINE_API void EvaluateComponentSpace(FComponentSpacePoseContext& Output);
842};
843
851USTRUCT()
853{
855
856
861 ENGINE_API virtual void Initialize_AnyThread(const FAnimationInitializeContext& Context);
862
869 ENGINE_API virtual void CacheBones_AnyThread(const FAnimationCacheBonesContext& Context);
870
878 ENGINE_API virtual void Update_AnyThread(const FAnimationUpdateContext& Context);
879
886 ENGINE_API virtual void Evaluate_AnyThread(FPoseContext& Output);
887
894 ENGINE_API virtual void EvaluateComponentSpace_AnyThread(FComponentSpacePoseContext& Output);
895
901 virtual void GatherDebugData(FNodeDebugData& DebugData)
902 {
903 DebugData.AddDebugItem(FString::Printf(TEXT("Non Overriden GatherDebugData! (%s)"), *DebugData.GetNodeName(this)));
904 }
905
911 virtual bool CanUpdateInWorkerThread() const { return true; }
912
919 virtual bool HasPreUpdate() const { return false; }
920
922 virtual void PreUpdate(const UAnimInstance* InAnimInstance) {}
923
930 virtual bool NeedsDynamicReset() const { return false; }
931
933 ENGINE_API virtual void ResetDynamics(ETeleportType InTeleportType);
934
936 virtual void PostCompile(const class USkeleton* InSkeleton) {}
937
943 virtual bool NeedsOnInitializeAnimInstance() const { return false; }
944
945 virtual ~FAnimNode_Base() {}
946
948 UE_DEPRECATED(4.20, "Please use ResetDynamics with an ETeleportPhysics flag instead")
949 virtual void ResetDynamics() {}
950 UE_DEPRECATED(5.0, "Please use IGraphMessage instead")
951 virtual bool WantsSkippedUpdates() const { return false; }
952 UE_DEPRECATED(5.0, "Please use IGraphMessage instead")
954 UE_DEPRECATED(5.0, "Please use the OverrideAssets API on UAnimGraphNode_Base to opt-in to child anim BP override functionality, or per-node specific asset override calls.")
955 virtual void OverrideAsset(class UAnimationAsset* NewAsset) {}
956
957 // The default handler for graph-exposed inputs:
958 ENGINE_API const FExposedValueHandler& GetEvaluateGraphExposedInputs() const;
959
960 // Initialization function for the default handler for graph-exposed inputs, used only by instancing code:
961 UE_DEPRECATED(5.0, "Exposed value handlers are now accessed via FAnimNodeConstantData")
962 void SetExposedValueHandler(const FExposedValueHandler* Handler) { }
963
964 // Get this node's index. The node index provides a unique key into its location within the class data
966 {
967 check(NodeData);
968 return NodeData->GetNodeIndex();
969 }
970
971 // Get the anim class that this node is hosted within
973 {
974 check(NodeData);
975 return &NodeData->GetAnimClassInterface();
976 }
977
978protected:
979 // Get anim node constant/folded data of the specified type given the identifier. Do not use directly - use GET_ANIM_NODE_DATA
980 template<typename DataType>
981 const DataType& GetData(UE::Anim::FNodeDataId InId, const UObject* InObject = nullptr) const
982 {
983#if WITH_EDITORONLY_DATA
984 if(NodeData)
985 {
986 return *static_cast<const DataType*>(NodeData->GetData(InId, this, InObject));
987 }
988 else
989 {
990 return *InId.GetProperty()->ContainerPtrToValuePtr<const DataType>(this);
991 }
992#else
993 check(NodeData);
994 return *static_cast<const DataType*>(NodeData->GetData(InId, this, InObject));
995#endif
996 }
997
998 // Get anim node constant/folded data of the specified type given the identifier. Do not use directly - use GET_MUTABLE_ANIM_NODE_DATA
999 // Note: will assert if data is not held on the instance/dynamic. Use GetInstanceDataPtr/GET_INSTANCE_ANIM_NODE_DATA_PTR if the value
1000 // might not be mutable, which will return null.
1001#if WITH_EDITORONLY_DATA
1002 template<typename DataType>
1003 DataType& GetMutableData(UE::Anim::FNodeDataId InId, UObject* InObject = nullptr)
1004 {
1005 if(NodeData)
1006 {
1007 return *static_cast<DataType*>(NodeData->GetMutableData(InId, this, InObject));
1008 }
1009 else
1010 {
1011 return *InId.GetProperty()->ContainerPtrToValuePtr<DataType>(this);
1012 }
1013 }
1014#endif
1015
1016 // Get anim node mutable data of the specified type given the identifier. Do not use directly - use GET_INSTANCE_ANIM_NODE_DATA_PTR
1017 // @return nullptr if the data is not mutable/dynamic
1018 template<typename DataType>
1020 {
1021#if WITH_EDITORONLY_DATA
1022 if(NodeData)
1023 {
1024 return static_cast<DataType*>(NodeData->GetInstanceData(InId, this, InObject));
1025 }
1026 else
1027 {
1028 return InId.GetProperty()->ContainerPtrToValuePtr<DataType>(this);
1029 }
1030#else
1031 check(NodeData);
1032 return static_cast<DataType*>(NodeData->GetInstanceData(InId, this, InObject));
1033#endif
1034 }
1035
1036protected:
1038 ENGINE_API bool IsLODEnabled(FAnimInstanceProxy* AnimInstanceProxy);
1039
1041 virtual int32 GetLODThreshold() const { return INDEX_NONE; }
1042
1044 ENGINE_API virtual void OnInitializeAnimInstance(const FAnimInstanceProxy* InProxy, const UAnimInstance* InAnimInstance);
1045
1046 friend struct FAnimInstanceProxy;
1047
1048private:
1049 // Access functions
1050 ENGINE_API const FAnimNodeFunctionRef& GetInitialUpdateFunction() const;
1051 ENGINE_API const FAnimNodeFunctionRef& GetBecomeRelevantFunction() const;
1052 ENGINE_API const FAnimNodeFunctionRef& GetUpdateFunction() const;
1053
1054private:
1059 friend class UAnimGraphNode_Base;
1060 friend struct FPoseLinkBase;
1061
1062 // Set the cached ptr to the constant/folded data for this node
1063 void SetNodeData(const FAnimNodeData& InNodeData) { NodeData = &InNodeData; }
1064
1065 // Reference to the constant/folded data for this node
1066 const FAnimNodeData* NodeData = nullptr;
1067
1068#if WITH_EDITORONLY_DATA
1069 // Function called on initial update
1070 UPROPERTY(meta=(FoldProperty))
1072
1073 // Function called on become relevant
1074 UPROPERTY(meta=(FoldProperty))
1076
1077 // Function called on update
1078 UPROPERTY(meta=(FoldProperty))
1080#endif
1081};
1082
1083#if WITH_EDITORONLY_DATA
1084#define VERIFY_ANIM_NODE_MEMBER_TYPE(Type, Identifier) static_assert(std::is_same_v<decltype(Identifier), Type>, "Incorrect return type used");
1085#else
1086#define VERIFY_ANIM_NODE_MEMBER_TYPE(Type, Identifier)
1087#endif
1088
1089#define GET_ANIM_NODE_DATA_ID_INTERNAL(Type, Identifier) \
1090 [this]() -> UE::Anim::FNodeDataId \
1091 { \
1092 VERIFY_ANIM_NODE_MEMBER_TYPE(Type, Identifier) \
1093 static UE::Anim::FNodeDataId CachedId_##Identifier; \
1094 if(!CachedId_##Identifier.IsValid()) \
1095 { \
1096 static const FName AnimName_##Identifier(#Identifier); \
1097 CachedId_##Identifier = UE::Anim::FNodeDataId(AnimName_##Identifier, this, StaticStruct()); \
1098 } \
1099 return CachedId_##Identifier; \
1100 }() \
1101
1102// Get some (potentially folded) anim node data. Only usable from within an anim node.
1103// This caches the node data ID in static contained in a local lambda for improved performance
1104#define GET_ANIM_NODE_DATA(Type, Identifier) (GetData<Type>(GET_ANIM_NODE_DATA_ID_INTERNAL(Type, Identifier)))
1105
1106// Get some anim node data that should be held on an instance. Only usable from within an anim node.
1107// @return nullptr if the data is not held on an instance (i.e. it is in constant sparse class data)
1108// This caches the node data ID in static contained in a local lambda for improved performance
1109#define GET_INSTANCE_ANIM_NODE_DATA_PTR(Type, Identifier) (GetInstanceDataPtr<Type>(GET_ANIM_NODE_DATA_ID_INTERNAL(Type, Identifier)))
1110
1111#if WITH_EDITORONLY_DATA
1112// Editor-only way of accessing mutable anim node data but with internal checks
1113#define GET_MUTABLE_ANIM_NODE_DATA(Type, Identifier) (GetMutableData<Type>(GET_ANIM_NODE_DATA_ID_INTERNAL(Type, Identifier)))
1114#endif
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define ANIM_NODE_DEBUG_MAX_CACHEPOSE
Definition AnimNodeBase.h:639
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define WITH_EDITORONLY_DATA
Definition CoreMiscDefines.h:24
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ETeleportType
Definition EngineTypes.h:2401
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
if(Failed) console_printf("Failed.\n")
Definition NameTypes.h:617
Definition AnimNodeBase.h:106
FScopedAnimNodeTracker()=default
~FScopedAnimNodeTracker()
Definition AnimNodeBase.h:115
FScopedAnimNodeTracker(FAnimNodeTracker *InTracker, FAnimNodeTracker::FKey InKey)
Definition AnimNodeBase.h:110
Definition AnimNodeBase.h:578
~FScopedExpectsAdditiveOverride()
Definition AnimNodeBase.h:587
FScopedExpectsAdditiveOverride(FPoseContext &InContext, bool bInExpectsAdditive)
Definition AnimNodeBase.h:580
Definition Text.h:385
static CORE_API TSharedRef< FTokenizedMessage > Create(EMessageSeverity::Type InSeverity, const FText &InMessageText=FText())
Definition TokenizedMessage.cpp:13
Definition AnimClassInterface.h:193
Definition ArrayView.h:139
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT void Push(ElementType &&Item)
Definition Array.h:1224
ElementType Pop(EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:1196
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Top() UE_LIFETIMEBOUND
Definition Array.h:1248
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition AssetRegistryState.h:50
Definition SharedPointer.h:153
Definition AnimBlueprintGeneratedClass.h:366
Definition AnimBlueprint.h:82
Definition AnimInstance.h:353
Definition AnimationAsset.h:1020
Definition Object.h:95
Definition UnrealTypePrivate.h:18
Definition Skeleton.h:295
Type
Definition TokenizedMessage.h:21
Definition AnimNodeBase.h:728
Type
Definition AnimNodeBase.h:730
@ false
Definition radaudio_common.h:23
Definition AnimInstanceProxy.h:144
Definition AnimNodeConstantData.h:14
Definition AnimNodeData.h:93
Definition AnimNodeFunctionRef.h:25
Definition AnimNodeBase.h:46
void CopyTopsOnly(const FAnimNodeTracker &Source)
Definition AnimNodeBase.h:88
FObjectKey FKey
Definition AnimNodeBase.h:47
NodeType * Top() const
Definition AnimNodeBase.h:82
FMap Map
Definition AnimNodeBase.h:51
FKey Push(NodeType *Node)
Definition AnimNodeBase.h:60
static FKey GetKey()
Definition AnimNodeBase.h:54
NodeType * Pop()
Definition AnimNodeBase.h:69
FAnimNode_Base * Pop(FKey Key)
Definition AnimNodeBase.h:75
Definition AnimNodeBase.h:853
virtual void GatherDebugData(FNodeDebugData &DebugData)
Definition AnimNodeBase.h:901
virtual ~FAnimNode_Base()
Definition AnimNodeBase.h:945
int32 GetNodeIndex() const
Definition AnimNodeBase.h:965
virtual int32 GetLODThreshold() const
Definition AnimNodeBase.h:1041
virtual bool NeedsOnInitializeAnimInstance() const
Definition AnimNodeBase.h:943
DataType * GetInstanceDataPtr(UE::Anim::FNodeDataId InId, UObject *InObject=nullptr)
Definition AnimNodeBase.h:1019
const IAnimClassInterface * GetAnimClassInterface() const
Definition AnimNodeBase.h:972
virtual bool HasPreUpdate() const
Definition AnimNodeBase.h:919
virtual bool NeedsDynamicReset() const
Definition AnimNodeBase.h:930
virtual bool CanUpdateInWorkerThread() const
Definition AnimNodeBase.h:911
const DataType & GetData(UE::Anim::FNodeDataId InId, const UObject *InObject=nullptr) const
Definition AnimNodeBase.h:981
virtual void PostCompile(const class USkeleton *InSkeleton)
Definition AnimNodeBase.h:936
virtual void PreUpdate(const UAnimInstance *InAnimInstance)
Definition AnimNodeBase.h:922
static bool IsRelevant(float InWeight)
Definition AnimTypes.h:666
Definition AnimNodeBase.h:159
ENGINE_API FAnimationBaseContext()
Definition AnimNodeBase.cpp:64
ENGINE_API UObject * GetAnimInstanceObject() const
Definition AnimNodeBase.cpp:85
int32 CurrentNodeId
Definition AnimNodeBase.h:310
void SetNodeIds(const FAnimationBaseContext &InContext)
Definition AnimNodeBase.h:289
NodeType * GetAncestor() const
Definition AnimNodeBase.h:212
void SetNodeId(int32 InNodeId)
Definition AnimNodeBase.h:283
FAnimationBaseContext & operator=(const FAnimationBaseContext &)=default
TGraphMessageType * FindMessage(TFunctionRef< bool(TGraphMessageType &)> InFunction) const
Definition AnimNodeBase.h:244
TGraphMessageType * GetMessage() const
Definition AnimNodeBase.h:225
FAnimationUpdateSharedContext * SharedContext
Definition AnimNodeBase.h:163
int32 PreviousNodeId
Definition AnimNodeBase.h:313
FAnimInstanceProxy * AnimInstanceProxy
Definition AnimNodeBase.h:161
FScopedAnimNodeTracker TrackAncestor(NodeType *Node) const
Definition AnimNodeBase.h:198
int32 GetPreviousNodeId() const
Definition AnimNodeBase.h:299
int32 GetCurrentNodeId() const
Definition AnimNodeBase.h:296
PRAGMA_DISABLE_DEPRECATION_WARNINGS FAnimationBaseContext(FAnimationBaseContext &&)=default
ENGINE_API void LogMessageInternal(FName InLogType, const TSharedRef< FTokenizedMessage > &InMessage) const
Definition AnimNodeBase.cpp:97
bool IsActive() const
Definition AnimNodeBase.h:302
FAnimationBaseContext(const FAnimationBaseContext &)=default
bool bIsActive
Definition AnimNodeBase.h:307
TGraphMessageType & GetMessageChecked() const
Definition AnimNodeBase.h:267
ENGINE_API IAnimClassInterface * GetAnimClass() const
Definition AnimNodeBase.cpp:80
ENGINE_API FAnimationBaseContext(UAnimInstance *InAnimInstance)
FAnimationBaseContext & operator=(FAnimationBaseContext &&)=default
Definition AnimNodeBase.h:337
FAnimationCacheBonesContext WithNodeId(int32 InNodeId) const
Definition AnimNodeBase.h:344
FAnimationCacheBonesContext(FAnimInstanceProxy *InAnimInstanceProxy)
Definition AnimNodeBase.h:339
Definition AnimNodeBase.h:324
FAnimationInitializeContext(FAnimInstanceProxy *InAnimInstanceProxy, FAnimationUpdateSharedContext *InSharedContext=nullptr)
Definition AnimNodeBase.h:326
Definition AnimNodeBase.h:354
float GetRootMotionWeightModifier() const
Definition AnimNodeBase.h:466
FAnimationUpdateContext FractionalWeight(float WeightMultiplier) const
Definition AnimNodeBase.h:414
FAnimationUpdateContext WithOtherProxy(FAnimInstanceProxy *InAnimInstanceProxy) const
Definition AnimNodeBase.h:390
FAnimationUpdateContext WithNodeId(int32 InNodeId) const
Definition AnimNodeBase.h:449
FAnimationUpdateContext(const FAnimationUpdateContext &Copy, FAnimInstanceProxy *InAnimInstanceProxy)
Definition AnimNodeBase.h:379
void LogMessage(const TSharedRef< FTokenizedMessage > &InMessage) const
Definition AnimNodeBase.h:472
FAnimationUpdateContext(FAnimInstanceProxy *InAnimInstanceProxy, float InDeltaTime, FAnimationUpdateSharedContext *InSharedContext=nullptr)
Definition AnimNodeBase.h:370
FAnimationUpdateContext FractionalWeightTimeAndRootMotion(float WeightMultiplier, float TimeMultiplier, float RootMotionMultiplier) const
Definition AnimNodeBase.h:439
FAnimationUpdateContext AsInactive() const
Definition AnimNodeBase.h:406
float GetFinalBlendWeight() const
Definition AnimNodeBase.h:463
FAnimationUpdateSharedContext * GetSharedContext() const
Definition AnimNodeBase.h:457
void LogMessage(EMessageSeverity::Type InSeverity, FText InMessage) const
Definition AnimNodeBase.h:473
FAnimationUpdateContext FractionalWeightAndTime(float WeightMultiplier, float TimeMultiplier) const
Definition AnimNodeBase.h:431
FAnimationUpdateContext(FAnimInstanceProxy *InAnimInstanceProxy=nullptr)
Definition AnimNodeBase.h:362
float GetDeltaTime() const
Definition AnimNodeBase.h:469
FAnimationUpdateContext FractionalWeightAndRootMotion(float WeightMultiplier, float RootMotionMultiplier) const
Definition AnimNodeBase.h:422
FAnimationUpdateContext WithOtherSharedContext(FAnimationUpdateSharedContext *InSharedContext) const
Definition AnimNodeBase.h:395
Definition AnimNodeBase.h:131
FAnimationUpdateSharedContext & operator=(const FAnimationUpdateSharedContext &)=delete
FAnimNodeTracker AncestorTracker
Definition AnimNodeBase.h:140
void CopyForCachedUpdate(FAnimationUpdateSharedContext &Source)
Definition AnimNodeBase.h:146
FAnimationUpdateSharedContext(FAnimationUpdateSharedContext &)=delete
UE::Anim::FMessageStack MessageStack
Definition AnimNodeBase.h:144
bool IsNormalized() const
Definition BonePose.h:286
void ResetToRefPose()
Definition BonePose.h:242
bool ContainsNaN() const
Definition BonePose.h:300
void SetBoneContainer(const FBoneContainer *InBoneContainer)
Definition BonePose.h:149
Definition AnimCurveTypes.h:1041
ENGINE_API void InitFrom(const FBoneContainer &InBoneContainer)
Definition AnimCurveTypes.cpp:726
Definition BoneContainer.h:192
Definition BonePose.h:408
Definition BonePose.h:356
Definition BonePose.h:347
ENGINE_API void ResetToAdditiveIdentity()
Definition BonePose.cpp:56
Definition AnimNodeBase.h:600
FComponentSpacePoseContext(const FComponentSpacePoseContext &SourceContext)
Definition AnimNodeBase.h:615
FComponentSpacePoseContext(FAnimInstanceProxy *InAnimInstanceProxy)
Definition AnimNodeBase.h:608
FBlendedCurve Curve
Definition AnimNodeBase.h:603
ENGINE_API bool IsNormalized() const
Definition AnimNodeBase.cpp:515
FComponentSpacePoseContext & operator=(const FComponentSpacePoseContext &)=default
ENGINE_API bool ContainsNaN() const
Definition AnimNodeBase.cpp:510
ENGINE_API void ResetToRefPose()
Definition AnimNodeBase.cpp:117
UE::Anim::FStackAttributeContainer CustomAttributes
Definition AnimNodeBase.h:604
FCSPose< FCompactPose > Pose
Definition AnimNodeBase.h:602
Definition ExposedValueHandler.h:50
Definition AnimTypes.h:144
Definition AnimNodeBase.h:675
bool bPoseSource
Definition AnimNodeBase.h:681
int32 ChainID
Definition AnimNodeBase.h:680
bool IsOnActiveBranch()
Definition AnimNodeBase.h:683
float AbsoluteWeight
Definition AnimNodeBase.h:678
int32 Indent
Definition AnimNodeBase.h:679
FString DebugLine
Definition AnimNodeBase.h:677
FFlattenedDebugData(FString Line, float AbsWeight, int32 InIndent, int32 InChainID, bool bInPoseSource)
Definition AnimNodeBase.h:676
Definition AnimNodeBase.h:642
FNodeDebugData(const class UAnimInstance *InAnimInstance)
Definition AnimNodeBase.h:686
ENGINE_API FNodeDebugData & BranchFlow(float BranchWeight, FString InNodeDescription=FString())
Definition AnimNodeBase.cpp:531
FString GetNodeName(Type *Node)
Definition AnimNodeBase.h:704
FNodeDebugData(const class UAnimInstance *InAnimInstance, const float AbsWeight, FString InNodeDescription, FNodeDebugData *InRootNodePtr)
Definition AnimNodeBase.h:692
ENGINE_API void AddDebugItem(FString DebugData, bool bPoseSource=false)
Definition AnimNodeBase.cpp:523
ENGINE_API FNodeDebugData * GetCachePoseDebugData(float GlobalWeight)
Definition AnimNodeBase.cpp:538
TArray< FFlattenedDebugData > GetFlattenedDebugData()
Definition AnimNodeBase.h:713
const UAnimInstance * AnimInstance
Definition AnimNodeBase.h:722
Definition ObjectKey.h:19
Definition AnimNodeBase.h:479
void LogMessage(EMessageSeverity::Type InSeverity, FText InMessage) const
Definition AnimNodeBase.h:523
bool ExpectsAdditivePose() const
Definition AnimNodeBase.h:567
FPoseContext(const FBoneContainer &InRequiredBones, bool bInExpectsAdditivePose=false)
Definition AnimNodeBase.h:509
bool IsNormalized() const
Definition AnimNodeBase.h:547
FPoseContext & operator=(const FPoseContext &Other)
Definition AnimNodeBase.h:552
void LogMessage(const TSharedRef< FTokenizedMessage > &InMessage) const
Definition AnimNodeBase.h:522
void ResetToRefPose()
Definition AnimNodeBase.h:525
FBlendedCurve Curve
Definition AnimNodeBase.h:483
FCompactPose Pose
Definition AnimNodeBase.h:482
UE::Anim::FStackAttributeContainer CustomAttributes
Definition AnimNodeBase.h:484
bool ContainsNaN() const
Definition AnimNodeBase.h:542
FPoseContext(FAnimInstanceProxy *InAnimInstanceProxy, bool bInExpectsAdditivePose=false)
Definition AnimNodeBase.h:490
void ResetToAdditiveIdentity()
Definition AnimNodeBase.h:537
FPoseContext(const FPoseContext &SourceContext, bool bInOverrideExpectsAdditivePose=false)
Definition AnimNodeBase.h:498
Definition AnimNodeBase.h:750
FPoseLinkBase()
Definition AnimNodeBase.h:782
FAnimNode_Base * LinkedNode
Definition AnimNodeBase.h:755
Definition PropertyAccess.h:402
Definition AnimNodeMessages.h:214
void ForEachMessage(TFunctionRef< EEnumerate(TGraphMessageType &)> InFunction) const
Definition AnimNodeMessages.h:245
void TopMessage(TFunctionRef< void(TGraphMessageType &)> InFunction) const
Definition AnimNodeMessages.h:259
ENGINE_API void CopyForCachedUpdate(const FMessageStack &InStack)
Definition AnimNodeMessages.cpp:188
Definition AnimNodeData.h:22
Definition AnimNodeFunctionRef.h:87
Definition AttributesRuntime.h:40