5#include "Containers/Array.h"
18#include "InterchangeFactoryBaseNode.generated.h"
23#define IMPLEMENT_NODE_ATTRIBUTE_DELEGATE_BY_PROPERTYNAME(AttributeName, AttributeType, ObjectType, PropertyName) \
24 bool ApplyCustom##AttributeName##ToAsset(UObject* Asset) const \
26 return ApplyAttributeToObject<AttributeType>(Macro_Custom##AttributeName##Key.Key, Asset, PropertyName); \
29 bool FillCustom##AttributeName##FromAsset(UObject* Asset) \
31 return FillAttributeFromObject<AttributeType>(Macro_Custom##AttributeName##Key.Key, Asset, PropertyName); \
34#define IMPLEMENT_NODE_ATTRIBUTE_SETTER(NodeClassName, AttributeName, AttributeType, AssetType) \
35 FString OperationName = GetTypeName() + TEXT(".Set" #AttributeName); \
36 if(InterchangePrivateNodeBase::SetCustomAttribute<AttributeType>(*Attributes, Macro_Custom##AttributeName##Key, OperationName, AttributeValue)) \
38 if(bAddApplyDelegate) \
40 FName AttributeNameImpl = TEXT(""#AttributeName); \
41 AttributesAppliedThroughDelegates.AddItem(Macro_Custom##AttributeName##Key.Key); \
42 AddApplyAndFillDelegates<AttributeType>(Macro_Custom##AttributeName##Key.Key, AssetType::StaticClass(), AttributeNameImpl); \
57#define IMPLEMENT_NODE_ATTRIBUTE_SETTER_WITH_CUSTOM_DELEGATE_WITH_CUSTOM_CLASS(NodeClassName, AttributeName, AttributeType, AssetType) \
58 FString OperationName = GetTypeName() + TEXT(".Set" #AttributeName); \
59 if(InterchangePrivateNodeBase::SetCustomAttribute<AttributeType>(*Attributes, Macro_Custom##AttributeName##Key, OperationName, AttributeValue)) \
61 if(bAddApplyDelegate) \
63 check(NodeClassName::StaticClass()->IsChildOf<UInterchangeFactoryBaseNode>()); \
64 AttributesAppliedThroughDelegates.AddItem(Macro_Custom##AttributeName##Key.Key); \
65 UClass* AssetClass = AssetType::StaticClass(); \
66 TArray<UE::Interchange::FApplyAttributeToAsset>& Delegates = ApplyCustomAttributeDelegates.FindOrAdd(AssetClass); \
67 Delegates.Add(UE::Interchange::FApplyAttributeToAsset::CreateUObject(this, &NodeClassName::ApplyCustom##AttributeName##ToAsset)); \
68 TArray<UE::Interchange::FFillAttributeToAsset>& FillDelegates = FillCustomAttributeDelegates.FindOrAdd(AssetClass); \
69 FillDelegates.Add(UE::Interchange::FFillAttributeToAsset::CreateUObject(this, &NodeClassName::FillCustom##AttributeName##FromAsset)); \
79#define IMPLEMENT_NODE_ATTRIBUTE_SETTER_WITH_CUSTOM_DELEGATE(NodeClassName, AttributeName, AttributeType) \
80 FString OperationName = GetTypeName() + TEXT(".Set" #AttributeName); \
81 if(InterchangePrivateNodeBase::SetCustomAttribute<AttributeType>(*Attributes, Macro_Custom##AttributeName##Key, OperationName, AttributeValue)) \
83 if(bAddApplyDelegate) \
85 check(NodeClassName::StaticClass()->IsChildOf<UInterchangeFactoryBaseNode>()); \
86 AttributesAppliedThroughDelegates.AddItem(Macro_Custom##AttributeName##Key.Key); \
87 TArray<UE::Interchange::FApplyAttributeToAsset>& Delegates = ApplyCustomAttributeDelegates.FindOrAdd(GetObjectClass()); \
88 Delegates.Add(UE::Interchange::FApplyAttributeToAsset::CreateUObject(this, &NodeClassName::ApplyCustom##AttributeName##ToAsset)); \
89 TArray<UE::Interchange::FFillAttributeToAsset>& FillDelegates = FillCustomAttributeDelegates.FindOrAdd(GetObjectClass()); \
90 FillDelegates.Add(UE::Interchange::FFillAttributeToAsset::CreateUObject(this, &NodeClassName::FillCustom##AttributeName##FromAsset)); \
104#define COPY_NODE_DELEGATES(SourceNode, AttributeName, AttributeType, AssetType) \
106 const UE::Interchange::FAttributeKey& AttributeKey = Macro_Custom##AttributeName##Key; \
107 FString OperationName = GetTypeName() + TEXT(".Get" #AttributeName); \
108 AttributeType AttributeValue; \
109 if(InterchangePrivateNodeBase::GetCustomAttribute<AttributeType>(*SourceNode->Attributes, AttributeKey, OperationName, AttributeValue)) \
111 FName PropertyName = TEXT(""#AttributeName); \
112 AddApplyAndFillDelegates<AttributeType>(AttributeKey.Key, AssetType::StaticClass(), PropertyName); \
116#define COPY_NODE_DELEGATES_WITH_CUSTOM_DELEGATE(SourceNode, NodeClassName, AttributeName, AttributeType, AssetClass) \
118 const UE::Interchange::FAttributeKey& AttributeKey = Macro_Custom##AttributeName##Key; \
119 FString OperationName = GetTypeName() + TEXT(".Get" #AttributeName); \
120 AttributeType AttributeValue; \
121 if(InterchangePrivateNodeBase::GetCustomAttribute<AttributeType>(*SourceNode->Attributes, AttributeKey, OperationName, AttributeValue)) \
123 TArray<UE::Interchange::FApplyAttributeToAsset>& Delegates = ApplyCustomAttributeDelegates.FindOrAdd(AssetClass); \
124 Delegates.Add(UE::Interchange::FApplyAttributeToAsset::CreateUObject(this, &NodeClassName::ApplyCustom##AttributeName##ToAsset)); \
125 TArray<UE::Interchange::FFillAttributeToAsset>& FillDelegates = FillCustomAttributeDelegates.FindOrAdd(AssetClass); \
126 FillDelegates.Add(UE::Interchange::FFillAttributeToAsset::CreateUObject(this, &NodeClassName::FillCustom##AttributeName##FromAsset)); \
130#define REFILL_CUSTOM_ATTRIBUTE_APPLY_DELEGATE(AttributeName, AttributeType) \
131if(AttributesAppliedThroughDelegatesKeySet.Contains(Macro_Custom##AttributeName##Key.Key)) \
133 AttributeType ValueData; \
134 if(GetCustom##AttributeName(ValueData)) \
136 constexpr const bool bAddApplyDelegate = true; \
137 SetCustom##AttributeName(ValueData, bAddApplyDelegate); \
141#define REFILL_CUSTOM_ATTRIBUTE_APPLY_DELEGATE_EXPLICIT(AttributeKey, Getter, Setter, AttributeType) \
142if(AttributesAppliedThroughDelegatesKeySet.Contains(AttributeKey)) \
144 AttributeType ValueData; \
145 if(Getter(ValueData)) \
147 constexpr const bool bAddApplyDelegate = true; \
148 Setter(ValueData, bAddApplyDelegate); \
186UCLASS(BlueprintType, MinimalAPI)
204 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
211 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
221 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
227 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
233 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
239 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
245 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
251 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
257 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node | ActorFactory")
263 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node | ActorFactory")
269 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
275 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
281 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
287 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
293 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
299 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
305 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
317 template<
typename AttributeType>
327 template<
typename AttributeType>
337 template<
typename AttributeType>
388 UFUNCTION(BlueprintCallable, Category =
"Interchange | Node")
394 UFUNCTION(BlueprintCallable, Category = "Interchange | Node")
400 UFUNCTION(BlueprintCallable, Category = "Interchange | Node")
407 UFUNCTION(BlueprintCallable, Category = "Interchange | Node")
434 TSet<FString> AttributesAppliedThroughDelegatesKeySet;
448 UE::Interchange::FApplyAttributeToAsset::CreateLambda(
457 UE::Interchange::FApplyAttributeToAsset::CreateLambda(
465template<
typename AttributeType>
473 AttributeType ValueData;
586template<
typename AttributeType>
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DELEGATE_RetVal_OneParam(ReturnValueType, DelegateName, Param1Type)
Definition DelegateCombinations.h:54
EReimportStrategyFlags
Definition InterchangeFactoryBaseNode.h:172
@ ApplyPipelineProperties
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
Definition UnrealType.h:2543
Definition NameTypes.h:617
Definition UnrealType.h:2725
Definition UnrealType.h:174
Definition UnrealString.h.inl:34
void Set(typename TIdentity< U >::Type &&Value)
Definition TVariant.h:193
Definition InterchangeBaseNodeUtilities.h:22
Definition InterchangeBaseNode.h:195
bool SetAttribute(const FString &NodeAttributeKey, const AttributeType &Value)
Definition InterchangeBaseNode.h:420
static INTERCHANGECORE_API void CopyStorage(const UInterchangeBaseNode *SourceNode, UInterchangeBaseNode *DestinationNode)
Definition InterchangeBaseNode.cpp:604
Definition InterchangeFactoryBaseNode.h:188
UE::Interchange::TArrayAttributeHelper< FString > FactoryDependencies
Definition InterchangeFactoryBaseNode.h:424
virtual void CopyWithObject(const UInterchangeFactoryBaseNode *SourceNode, UObject *Object)
Definition InterchangeFactoryBaseNode.h:345
UE::Interchange::TArrayAttributeHelper< FString > AttributesAppliedThroughDelegates
Definition InterchangeFactoryBaseNode.h:431
TMap< UClass *, TArray< UE::Interchange::FFillAttributeToAsset > > FillCustomAttributeDelegates
Definition InterchangeFactoryBaseNode.h:429
bool ApplyAttributeToObject(const FString &NodeAttributeKey, UObject *Object, const FName PropertyName) const
Definition InterchangeFactoryBaseNode.h:466
TMap< UClass *, TArray< UE::Interchange::FApplyAttributeToAsset > > ApplyCustomAttributeDelegates
Definition InterchangeFactoryBaseNode.h:427
bool FillAttributeFromObject(const FString &NodeAttributeKey, UObject *Object, const FName PropertyName)
Definition InterchangeFactoryBaseNode.h:587
COREUOBJECT_API FString GetPathName(const UObject *StopOuter=NULL) const
Definition UObjectBaseUtility.cpp:38
INTERCHANGECORE_API FProperty * FindPropertyByPathChecked(TVariant< UObject *, uint8 * > &Container, UStruct *Outer, FStringView PropertyPath)
Definition InterchangeBaseNode.cpp:609
Definition InterchangeHelper.cpp:9
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
Definition AttributeCurve.h:23
Definition SoftObjectPath.h:56
Definition AttributeStorage.h:67
Definition InterchangeBaseNode.h:157
Definition InterchangeFactoryBaseNode.h:160
static INTERCHANGECORE_API const FAttributeKey & ReimportStrategyFlagsKey()
Definition InterchangeFactoryBaseNode.cpp:30
static INTERCHANGECORE_API const FAttributeKey & SkipNodeImportKey()
Definition InterchangeFactoryBaseNode.cpp:36
static INTERCHANGECORE_API const FAttributeKey & ForceNodeReimportKey()
Definition InterchangeFactoryBaseNode.cpp:42
static INTERCHANGECORE_API const FString & AttributesAppliedThroughDelegatesBaseKey()
Definition InterchangeFactoryBaseNode.cpp:24
static INTERCHANGECORE_API const FString & FactoryDependenciesBaseKey()
Definition InterchangeFactoryBaseNode.cpp:18