UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimNodeFunctionRef.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"
6#include "AnimNodeFunctionRef.generated.h"
7
9struct FPoseLink;
10struct FPoseLinkBase;
12struct FAnimNode_Base;
16struct FPoseContext;
19
23USTRUCT()
25{
27
28public:
29 // Cache the function ptr from the name
31
32 // Call the function
33 ENGINE_API void Call(UObject* InObject, void* InParameters = nullptr) const;
34
35 // Set the function via name
36 void SetFromFunctionName(FName InName) { FunctionName = InName; ClassName = NAME_None; }
37
38 // Set the function via a function
39 ENGINE_API void SetFromFunction(UFunction* InFunction);
40
41 // Get the function name
42 FName GetFunctionName() const { return FunctionName; }
43
44 // Get the function we reference
45 UFunction* GetFunction() const { return Function; }
46
47 // Check if we reference a valid function
48 bool IsValid() const { return Function != nullptr; }
49
50 // Override operator== as we only need to compare class/function names
52 {
53 return ClassName == InOther.ClassName && FunctionName == InOther.FunctionName;
54 }
55
56private:
57 // The name of the class to call the function with. If this is NAME_None, we assume this is a 'thiscall', if it is valid then we assume (and verify) we should call the function on a function library CDO.
58 UPROPERTY()
59 FName ClassName = NAME_None;
60
61 // The name of the function to call
62 UPROPERTY()
63 FName FunctionName = NAME_None;
64
65 // The class to use to call the function with, recovered by looking for a class of name FunctionName
67 TObjectPtr<const UClass> Class = nullptr;
68
69 // The function to call, recovered by looking for a function of name FunctionName
71 TObjectPtr<UFunction> Function = nullptr;
72};
73
76{
77 enum
78 {
79 WithIdenticalViaEquality = true,
80 };
81};
82
83namespace UE { namespace Anim {
84
85// Wrapper used to call anim node functions
87{
88private:
89 friend struct ::FPoseLinkBase;
90 friend struct ::FPoseLink;
91 friend struct ::FComponentSpacePoseLink;
92 friend struct ::FAnimInstanceProxy;
93 friend struct ::FAnimNode_StateMachine;
94
95 // Call the InitialUpdate function of this node
97
98 // Call the BecomeRelevant function of this node
99 static void BecomeRelevant(const FAnimationUpdateContext& InContext, FAnimNode_Base& InNode);
100
101 // Call the Update function of this node
103
104public:
105 // Call a generic function for this node
107};
108
109}}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define CallFunction(Capability, ReturnValue, FunctionName,...)
Definition TypedElementQueryContextImplementation.inl:56
Definition NameTypes.h:617
Definition Class.h:3793
Definition Class.h:2476
Definition Object.h:95
Definition AdvancedWidgetsModule.cpp:13
Definition AnimInstanceProxy.h:144
Definition AnimNodeFunctionRef.h:25
FName GetFunctionName() const
Definition AnimNodeFunctionRef.h:42
bool operator==(const FAnimNodeFunctionRef &InOther) const
Definition AnimNodeFunctionRef.h:51
UFunction * GetFunction() const
Definition AnimNodeFunctionRef.h:45
bool IsValid() const
Definition AnimNodeFunctionRef.h:48
void SetFromFunctionName(FName InName)
Definition AnimNodeFunctionRef.h:36
Definition AnimNodeBase.h:853
Definition AnimNode_StateMachine.h:123
Definition AnimNodeBase.h:159
Definition AnimNodeBase.h:324
Definition AnimNodeBase.h:354
Definition AnimNodeBase.h:600
Definition AnimNodeBase.h:479
Definition AnimNodeBase.h:750
Definition ObjectPtr.h:488
Definition StructOpsTypeTraits.h:11
Definition StructOpsTypeTraits.h:46
Definition AnimNodeFunctionRef.h:87