UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimNode_CustomProperty.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"
10#include "AnimNode_CustomProperty.generated.h"
11
25USTRUCT()
27{
29
30public:
31
35
36 /* Set Target Instance */
37 ENGINE_API void SetTargetInstance(UObject* InInstance);
38
39 /* Get Target Instance by type for convenience */
40 template<class T>
42 {
43 if (IsValid(TargetInstance))
44 {
45 return Cast<T>(TargetInstance);
46 }
47
48 return nullptr;
49 }
50
51 // We only subscribe to the OnInitializeAnimInstance path because we need to cache our source object, so we only
52 // override these methods in editor at the moment
53#if WITH_EDITOR
54 // FAnimNode_Base interface
55 ENGINE_API virtual void OnInitializeAnimInstance(const FAnimInstanceProxy* InProxy, const UAnimInstance* InAnimInstance) override;
56 virtual bool NeedsOnInitializeAnimInstance() const override { return true; }
57
58 // Handle object reinstancing in editor
60#endif
61
62protected:
64 UPROPERTY(meta=(BlueprintCompilerGeneratedDefaults))
65 TArray<FName> SourcePropertyNames;
66
68 UPROPERTY(meta=(BlueprintCompilerGeneratedDefaults))
69 TArray<FName> DestPropertyNames;
70
73 TObjectPtr<UObject> TargetInstance;
74
76 TArray<FProperty*> SourceProperties;
77
79 TArray<FProperty*> DestProperties;
80
81 /* Initialize property links from the source instance, in this case AnimInstance
82 * Compiler creates those properties during compile time */
84
85 /* Propagate the Source Instances' properties to Target Instance*/
86 ENGINE_API virtual void PropagateInputProperties(const UObject* InSourceInstance);
87
89 virtual UClass* GetTargetClass() const PURE_VIRTUAL(FAnimNode_CustomProperty::GetTargetClass, return nullptr;);
90
91#if WITH_EDITOR
99#endif // WITH_EDITOR
100
101#if WITH_EDITORONLY_DATA
102protected:
106#endif
107
108 // Stats
109#if ANIMNODE_STATS_VERBOSE
110 // Cached StatID for this node
111 TStatId StatID;
112 virtual void InitializeStatID() { StatID = FDynamicStats::CreateStatId<FStatGroup_STATGROUP_Anim>(FString(TEXT("Unknown"))); }
113#endif // ANIMNODE_STATS_VERBOSE
114
115 friend class UAnimGraphNode_CustomProperty;
116 friend class UAnimInstance;
117 friend class UControlRigLayerInstance;
118};
119
120template<>
122{
123 enum
124 {
126 };
127};
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
#define TEXT(x)
Definition Platform.h:1272
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
Definition NameTypes.h:617
Definition UnrealType.h:174
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition AnimInstance.h:353
Definition Class.h:3793
Definition Object.h:95
Definition AnimInstanceProxy.h:144
Definition AnimNodeBase.h:853
Definition AnimNode_CustomProperty.h:27
ENGINE_API FAnimNode_CustomProperty(const FAnimNode_CustomProperty &)
ENGINE_API ~FAnimNode_CustomProperty()
T * GetTargetInstance() const
Definition AnimNode_CustomProperty.h:41
Definition ObjectPtr.h:488
Definition LightweightStats.h:416
Definition StructOpsTypeTraits.h:11
@ WithPureVirtual
Definition StructOpsTypeTraits.h:33
Definition StructOpsTypeTraits.h:46