UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimClassInterface.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/Object.h"
8#include "UObject/Interface.h"
12#include "UObject/FieldPath.h"
13
14#include "AnimClassInterface.generated.h"
15
16class USkeleton;
23struct FAnimNode_Base;
24struct FAnimNodeData;
25enum class EAnimNodeDataFlags : uint32;
26namespace UE { namespace Anim { struct FNodeDataId; } }
27
29USTRUCT()
31{
33
37 , OutputPoseNodeIndex(INDEX_NONE)
38 , OutputPoseNodeProperty(nullptr)
39 , bImplemented(false)
40 {}
41
43 : Name(InName)
45 , OutputPoseNodeIndex(INDEX_NONE)
46 , OutputPoseNodeProperty(nullptr)
47 , bImplemented(false)
48 {}
49
50 // Disable compiler-generated deprecation warnings by implementing our own destructor/copy assignment/etc
56
58 {
59 return Name == InFunction.Name;
60 }
61
63 UPROPERTY()
65
67 UPROPERTY()
69
71 UPROPERTY()
72 int32 OutputPoseNodeIndex;
73
75 UPROPERTY()
76 TArray<FName> InputPoseNames;
77
79 UPROPERTY()
80 TArray<int32> InputPoseNodeIndices;
81
83 FStructProperty* OutputPoseNodeProperty;
84
86 TArray< FStructProperty* > InputPoseNodeProperties;
87
88 // A named input property
90 {
91 // The name of the property
93
94 // The input property (on the stub function)
95 FProperty* FunctionProperty = nullptr;
96
97 // The input property itself (on this class, not the stub function)
98 FProperty* ClassProperty = nullptr;
99 };
100
103
104 UE_DEPRECATED(5.0, "Please use InputPropertyData.")
105 TArray< FProperty* > InputProperties;
106
109 bool bImplemented;
110};
111
113USTRUCT()
115{
117
118 UPROPERTY()
119 TArray<int32> OrderedSavedPoseNodeIndices;
120
121 bool operator==(const FCachedPoseIndices& InOther) const
122 {
123 return OrderedSavedPoseNodeIndices == InOther.OrderedSavedPoseNodeIndices;
124 }
125};
126
128USTRUCT()
136
138USTRUCT()
140{
142
143
147 UPROPERTY(EditAnywhere, Category = GraphBlending)
148 float BlendInTime;
149
153 UPROPERTY(EditAnywhere, Category = GraphBlending, meta = (UseAsBlendProfile = true))
154 TObjectPtr<UBlendProfile> BlendInProfile;
155
160 UPROPERTY(EditAnywhere, Category = GraphBlending)
161 float BlendOutTime;
162
166 UPROPERTY(EditAnywhere, Category = GraphBlending, meta = (UseAsBlendProfile = true))
167 TObjectPtr<UBlendProfile> BlendOutProfile;
168
170 : BlendInTime(-1.0f)
171 , BlendInProfile(nullptr)
172 , BlendOutTime(-1.0f)
173 , BlendOutProfile(nullptr)
174 {}
175};
176
177// How to proceed when enumerating subsystems
179{
180 Stop,
182};
183
184UINTERFACE(MinimalAPI)
189
191
193{
195public:
197 virtual const TArray<FAnimNotifyEvent>& GetAnimNotifies() const = 0;
199 UE_DEPRECATED(4.24, "Function has been renamed, please use GetLinkedAnimGraphNodeProperties")
202 UE_DEPRECATED(4.24, "Function has been renamed, please use GetLinkedLayerNodeProperties")
209 UE_DEPRECATED(5.0, "Please use GetSubsystem<FAnimSubsystem_Base>")
217 virtual int32 GetSyncGroupIndex(FName SyncGroupName) const = 0;
218 UE_DEPRECATED(5.0, "Please use GetSubsystem<FAnimSubsystem_PropertyAccess>")
220
221 // Iterate over each subsystem for this class, supplying both the constant (FAnimSubsystem) and mutable (FAnimSubsystemInstance) data
224
225 // Find a subsystem's class-resident data. If no subsystem of the type exists this will return nullptr.
226 // @param InSubsystemType The subsystem's type
228
229 // Get a subsystem's class-resident data. If no subsystem of the type exists this will return nullptr.
232 {
233 const FAnimSubsystem* Subsystem = FindSubsystem(SubsystemType::StaticStruct());
234 return static_cast<const SubsystemType*>(Subsystem);
235 }
236
237 // Get a subsystem's class-resident data. If no subsystem of the type exists this will assert.
238 template<typename SubsystemType>
240 {
241 const FAnimSubsystem* Subsystem = FindSubsystem(SubsystemType::StaticStruct());
242 check(Subsystem);
243 return static_cast<const SubsystemType&>(*Subsystem);
244 }
245
246 // Check whether a node at the specified index has the specified flags
248
249protected:
250 // These direct accessors are here to allow internal access that doesnt redirect to the root class
253 virtual const TArray<FName>& GetSyncGroupNames_Direct() const = 0;
257 UE_DEPRECATED(5.0, "Please use GetSubsystem<FAnimSubsystem_PropertyAccess>")
259
264
265 // Access the various constant and mutable values
267 virtual const void* GetMutableNodeValueRaw(int32 InIndex, const UObject* InObject) const = 0;
268
269 // Get the struct that holds the mutable data
270 // @param InObject The anim instance object that holds the mutable data
273
274 // Get the struct that holds the constant data
275 virtual const void* GetConstantNodeData() const = 0;
276
277 // Get the anim node data used for each node's constant/folded data
279
280 // Get the (editor-only data) index of the property
282
283 // Get the number of properties (including editor only properties) that the anim node type has
285
286#if WITH_EDITORONLY_DATA
287 // Check that the serialized NodeTypeMap can be used with the current set of native node data layouts
288 virtual bool IsDataLayoutValid() const = 0;
289#endif
290public:
291
292 // Get the root anim class interface (i.e. if this is a derived class).
293 // Some properties that are derived from the compiled anim graph are routed to the 'Root' class
294 // as child classes don't get fully compiled. Instead they just override various asset players leaving the
295 // full compilation up to the base class.
297
299
301
302 static ENGINE_API UClass* GetActualAnimClass(IAnimClassInterface* AnimClassInterface);
303
304 static ENGINE_API const UClass* GetActualAnimClass(const IAnimClassInterface* AnimClassInterface);
305
307
315
316 // Get the object ptr given an anim node
318
319 // Get an anim node of the specified type given the object & node index
320 // Asserts if InObject is nullptr
321 // @return nullptr if the node index was out of bounds or the incorrect type
323
324 // Get an anim node of the specified type given the object & node index
325 // Asserts if InObject is nullptr, the node index is out of bounds or the node is the incorrect type
326 template<typename NodeType>
327 static const NodeType& GetAnimNodeFromObjectPtrChecked(const UObject* InObject, int32 InNodeIndex)
328 {
329 const FAnimNode_Base* NodePtr = GetAnimNodeFromObjectPtr(InObject, InNodeIndex, NodeType::StaticStruct());
330 check(NodePtr);
331 return static_cast<NodeType&>(*NodePtr);
332 }
333
334 UE_DEPRECATED(4.23, "Please use GetAnimBlueprintFunctions()")
336
337 UE_DEPRECATED(4.23, "Please use GetAnimBlueprintFunctions()")
339};
EAnimSubsystemEnumeration
Definition AnimClassInterface.h:179
TFieldPath< FStructProperty > FStructPropertyPath
Definition AnimClassInterface.h:190
EAnimNodeDataFlags
Definition AnimNodeData.h:73
#define check(expr)
Definition AssertionMacros.h:314
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
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
return true
Definition ExternalRpcRegistry.cpp:601
#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 UINTERFACE(...)
Definition ObjectMacros.h:780
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition UnrealType.h:174
Definition UnrealType.h:6306
Definition AnimClassInterface.h:193
virtual const TArray< FBakedAnimationStateMachine > & GetBakedStateMachines() const =0
virtual const TArray< FBakedAnimationStateMachine > & GetBakedStateMachines_Direct() const =0
const SubsystemType * FindSubsystem() const
Definition AnimClassInterface.h:231
virtual USkeleton * GetTargetSkeleton() const =0
virtual const void * GetConstantNodeValueRaw(int32 InIndex) const =0
virtual void ForEachSubsystem(TFunctionRef< EAnimSubsystemEnumeration(const FAnimSubsystemContext &)> InFunction) const =0
virtual int32 GetAnimNodePropertyCount(const UScriptStruct *InNodeType) const =0
virtual FStructProperty * GetRootAnimNodeProperty() const
Definition AnimClassInterface.h:338
virtual ENGINE_API const FPropertyAccessLibrary & GetPropertyAccessLibrary_Direct() const
Definition AnimClassInterface.cpp:118
virtual const TMap< FName, FGraphAssetPlayerInformation > & GetGraphAssetPlayerInformation_Direct() const =0
virtual const TMap< FName, FAnimGraphBlendOptions > & GetGraphBlendOptions() const =0
virtual const TArray< FAnimNotifyEvent > & GetAnimNotifies_Direct() const =0
virtual TArrayView< const FAnimNodeData > GetNodeData() const =0
friend struct UE::Anim::FNodeDataId
Definition AnimClassInterface.h:263
virtual const TMap< FName, FAnimGraphBlendOptions > & GetGraphBlendOptions_Direct() const =0
virtual const TArray< FStructProperty * > & GetAnimNodeProperties() const =0
virtual ENGINE_API const FPropertyAccessLibrary & GetPropertyAccessLibrary() const
Definition AnimClassInterface.cpp:111
virtual const TArray< FStructProperty * > & GetPreUpdateNodeProperties() const =0
virtual const TArray< FStructProperty * > & GetLinkedAnimGraphNodeProperties() const =0
static const NodeType & GetAnimNodeFromObjectPtrChecked(const UObject *InObject, int32 InNodeIndex)
Definition AnimClassInterface.h:327
virtual const FAnimBlueprintMutableData * GetMutableNodeData(const UObject *InObject) const =0
static ENGINE_API bool HasNodeAnyFlags(IAnimClassInterface *InAnimClassInterface, int32 InNodeIndex, EAnimNodeDataFlags InNodeDataFlags)
Definition AnimClassInterface.cpp:170
virtual const TArray< FAnimBlueprintFunction > & GetAnimBlueprintFunctions() const =0
virtual int32 GetRootAnimNodeIndex() const
Definition AnimClassInterface.h:335
static ENGINE_API const UObject * GetObjectPtrFromAnimNode(const IAnimClassInterface *InAnimClassInterface, const FAnimNode_Base *InNode)
Definition AnimClassInterface.cpp:148
virtual const TArray< FStructProperty * > & GetDynamicResetNodeProperties() const =0
virtual const TArray< FStructProperty * > & GetLinkedAnimLayerNodeProperties() const =0
static ENGINE_API IAnimClassInterface * GetFromClass(UClass *InClass)
Definition AnimClassInterface.cpp:31
virtual const TArray< FName > & GetSyncGroupNames() const =0
virtual const TMap< FName, FGraphAssetPlayerInformation > & GetGraphAssetPlayerInformation() const =0
virtual const TArray< FStructProperty * > & GetLayerNodeProperties() const
Definition AnimClassInterface.h:203
virtual int32 GetSyncGroupIndex(FName SyncGroupName) const =0
virtual const void * GetMutableNodeValueRaw(int32 InIndex, const UObject *InObject) const =0
virtual const TArray< FStructProperty * > & GetStateMachineNodeProperties() const =0
virtual ENGINE_API const TArray< FExposedValueHandler > & GetExposedValueHandlers() const
Definition AnimClassInterface.cpp:105
virtual const TArray< FAnimNotifyEvent > & GetAnimNotifies() const =0
static ENGINE_API const FAnimNode_Base * GetAnimNodeFromObjectPtr(const UObject *InObject, int32 InNodeIndex, UScriptStruct *InNodeType)
Definition AnimClassInterface.cpp:155
static ENGINE_API const FAnimBlueprintFunction * FindAnimBlueprintFunction(IAnimClassInterface *AnimClassInterface, const FName &InFunctionName)
Definition AnimClassInterface.cpp:77
static ENGINE_API bool IsAnimBlueprintFunction(IAnimClassInterface *InAnimClassInterface, const UFunction *InFunction)
Definition AnimClassInterface.cpp:90
virtual const TArray< FStructProperty * > & GetInitializationNodeProperties() const =0
ENGINE_API const IAnimClassInterface * GetRootClass() const
Definition AnimClassInterface.cpp:10
virtual const void * GetConstantNodeData() const =0
virtual const TMap< FName, FCachedPoseIndices > & GetOrderedSavedPoseNodeIndicesMap_Direct() const =0
virtual int32 GetAnimNodePropertyIndex(const UScriptStruct *InNodeType, FName InPropertyName) const =0
virtual const TMap< FName, FCachedPoseIndices > & GetOrderedSavedPoseNodeIndicesMap() const =0
const SubsystemType & GetSubsystem() const
Definition AnimClassInterface.h:239
static ENGINE_API UClass * GetActualAnimClass(IAnimClassInterface *AnimClassInterface)
Definition AnimClassInterface.cpp:51
virtual const TArray< FStructProperty * > & GetSubInstanceNodeProperties() const
Definition AnimClassInterface.h:200
virtual const TArray< FName > & GetSyncGroupNames_Direct() const =0
Definition ArrayView.h:139
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition AnimBlueprintGeneratedClass.h:366
Definition AnimClassInterface.h:186
Definition BlendProfile.h:132
Definition Class.h:3793
Definition Class.h:2476
Definition Interface.h:19
Definition Object.h:95
Definition Class.h:1720
Definition Skeleton.h:295
Definition AdvancedWidgetsModule.cpp:13
@ false
Definition radaudio_common.h:23
Definition AnimBlueprintGeneratedClass.h:338
Definition AnimClassInterface.h:90
Definition AnimClassInterface.h:31
PRAGMA_DISABLE_DEPRECATION_WARNINGS ~FAnimBlueprintFunction()=default
PRAGMA_ENABLE_DEPRECATION_WARNINGS bool operator==(const FAnimBlueprintFunction &InFunction) const
Definition AnimClassInterface.h:57
FAnimBlueprintFunction(const FAnimBlueprintFunction &)=default
FAnimBlueprintFunction & operator=(const FAnimBlueprintFunction &)=default
FAnimBlueprintFunction(const FName &InName)
Definition AnimClassInterface.h:42
TArray< FInputPropertyData > InputPropertyData
Definition AnimClassInterface.h:102
Definition AnimBlueprintGeneratedClass.h:330
Definition AnimClassInterface.h:140
Definition AnimNodeConstantData.h:14
Definition AnimNodeData.h:93
Definition AnimNodeBase.h:853
Definition AnimSubsystem.h:14
Definition AnimSubsystem.h:25
Definition AnimSubsystem_PropertyAccess.h:32
Definition AnimSubsystem.h:101
Definition AnimClassInterface.h:115
Definition ExposedValueHandler.h:50
Definition AnimClassInterface.h:130
Definition PropertyAccess.h:402
Definition FieldPath.h:283
Definition ObjectPtr.h:488