21#include "AnimNodeBase.generated.h"
23#define DECLARE_SCOPE_HIERARCHICAL_COUNTER_ANIMNODE(Method) \
24 DECLARE_SCOPE_HIERARCHICAL_COUNTER_FUNC()
26#ifndef UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER
27 #define UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER 0
53 template<
typename NodeType>
56 return FKey(NodeType::StaticStruct());
59 template<
typename NodeType>
68 template<
typename NodeType>
72 return Stack ?
static_cast<NodeType*
>(Stack->
Pop()) :
nullptr;
78 return Stack ? Stack->
Pop() :
nullptr;
81 template<
typename NodeType>
85 return (Stack && Stack->
Num() != 0) ?
static_cast<NodeType*
>(Stack->
Top()) :
nullptr;
91 Map.Reserve(Source.Map.Num());
92 for (
const auto& Iter : Source.Map)
94 if (Iter.Value.Num() != 0)
97 Stack.
Push(Iter.Value.Top());
119 Tracker->
Pop(TrackedKey);
138#if !UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER
139 UE_DEPRECATED(5.0,
"Please use the message & tagging system in UE::Anim::FMessageStack")
148#if !UE_ANIM_REMOVE_DEPRECATED_ANCESTOR_TRACKER
189#if WITH_EDITORONLY_DATA
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")
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")
216 return static_cast<NodeType*
>(Node);
224 template<
typename TGraphMessageType>
243 template<
typename TGraphMessageType>
266 template<
typename TGraphMessageType>
278 check(Message !=
nullptr);
357 float RootMotionWeightModifier;
364 , CurrentWeight(1.0f)
365 , RootMotionWeightModifier(1.0f)
372 , CurrentWeight(1.0f)
373 , RootMotionWeightModifier(1.0f)
381 , CurrentWeight(
Copy.CurrentWeight)
382 , RootMotionWeightModifier(
Copy.RootMotionWeightModifier)
383 , DeltaTime(
Copy.DeltaTime)
409 Result.bIsActive =
false;
434 Result.DeltaTime = DeltaTime * TimeMultiplier;
442 Result.DeltaTime = DeltaTime * TimeMultiplier;
518 UE_DEPRECATED(5.2,
"This function will be made private. It should never be called externally, use the constructor instead.")
527 if (bExpectsAdditivePose)
562 bExpectsAdditivePose =
Other.bExpectsAdditivePose;
573 bool bExpectsAdditivePose;
589 Context.bExpectsAdditivePose = bPreviousValue;
637#define ANIM_NODE_DEBUG_MAX_CHAIN 50
638#define ANIM_NODE_DEBUG_MAX_CHILDREN 12
639#define ANIM_NODE_DEBUG_MAX_CACHEPOSE 20
659 float AbsoluteWeight;
665 FString NodeDescription;
706 FString
FinalString = FString::Printf(
TEXT(
"%s<W:%.1f%%> %s"), *Node->StaticStruct()->GetName(), AbsoluteWeight*100.f, *NodeDescription);
707 NodeDescription.Empty();
745#define ENABLE_ANIMGRAPH_TRAVERSAL_DEBUG 0
748USTRUCT(BlueprintInternalUseOnly)
759 UPROPERTY(meta=(BlueprintCompilerGeneratedDefaults))
762#if WITH_EDITORONLY_DATA
764 UPROPERTY(meta=(BlueprintCompilerGeneratedDefaults))
768#if ENABLE_ANIMGRAPH_TRAVERSAL_DEBUG
783 : LinkedNode(nullptr)
814#define ENABLE_ANIMNODE_POSE_DEBUG 0
817USTRUCT(BlueprintInternalUseOnly)
826#if ENABLE_ANIMNODE_POSE_DEBUG
834USTRUCT(BlueprintInternalUseOnly)
948 UE_DEPRECATED(4.20,
"Please use ResetDynamics with an ETeleportPhysics flag instead")
951 virtual bool WantsSkippedUpdates()
const {
return false; }
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.")
961 UE_DEPRECATED(5.0,
"Exposed value handlers are now accessed via FAnimNodeConstantData")
968 return NodeData->GetNodeIndex();
975 return &NodeData->GetAnimClassInterface();
980 template<
typename DataType>
983#if WITH_EDITORONLY_DATA
986 return *
static_cast<const DataType*
>(NodeData->GetData(
InId,
this, InObject));
990 return *
InId.GetProperty()->ContainerPtrToValuePtr<
const DataType>(
this);
994 return *
static_cast<const DataType*
>(NodeData->GetData(
InId,
this, InObject));
1001#if WITH_EDITORONLY_DATA
1002 template<
typename DataType>
1007 return *
static_cast<DataType*
>(NodeData->GetMutableData(
InId,
this, InObject));
1011 return *
InId.GetProperty()->ContainerPtrToValuePtr<DataType>(
this);
1018 template<
typename DataType>
1021#if WITH_EDITORONLY_DATA
1024 return static_cast<DataType*
>(NodeData->GetInstanceData(
InId,
this, InObject));
1028 return InId.GetProperty()->ContainerPtrToValuePtr<DataType>(
this);
1032 return static_cast<DataType*
>(NodeData->GetInstanceData(
InId,
this, InObject));
1059 friend class UAnimGraphNode_Base;
1068#if WITH_EDITORONLY_DATA
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");
1086#define VERIFY_ANIM_NODE_MEMBER_TYPE(Type, Identifier)
1089#define GET_ANIM_NODE_DATA_ID_INTERNAL(Type, Identifier) \
1090 [this]() -> UE::Anim::FNodeDataId \
1092 VERIFY_ANIM_NODE_MEMBER_TYPE(Type, Identifier) \
1093 static UE::Anim::FNodeDataId CachedId_##Identifier; \
1094 if(!CachedId_##Identifier.IsValid()) \
1096 static const FName AnimName_##Identifier(#Identifier); \
1097 CachedId_##Identifier = UE::Anim::FNodeDataId(AnimName_##Identifier, this, StaticStruct()); \
1099 return CachedId_##Identifier; \
1104#define GET_ANIM_NODE_DATA(Type, Identifier) (GetData<Type>(GET_ANIM_NODE_DATA_ID_INTERNAL(Type, Identifier)))
1109#define GET_INSTANCE_ANIM_NODE_DATA_PTR(Type, Identifier) (GetInstanceDataPtr<Type>(GET_ANIM_NODE_DATA_ID_INTERNAL(Type, Identifier)))
1111#if WITH_EDITORONLY_DATA
1113#define GET_MUTABLE_ANIM_NODE_DATA(Type, Identifier) (GetMutableData<Type>(GET_ANIM_NODE_DATA_ID_INTERNAL(Type, Identifier)))
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
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ETeleportType
Definition EngineTypes.h:2401
#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
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
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 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
FAnimationUpdateSharedContext()=default
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 AnimNodeBase.h:836
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 AnimNodeBase.h:819
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