UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InterchangeAssetImportData.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"
11#include "UObject/Class.h"
12#include "UObject/Object.h"
14
15#include "InterchangeAssetImportData.generated.h"
16
18
19UCLASS(BlueprintType, MinimalAPI)
21{
23public:
24 // Begin UObject interface
25 virtual void PostLoad() override;
26 virtual void Serialize(FArchive& Ar) override;
27 // End UObject interface
28
29#if WITH_EDITOR
31#endif
32
36 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
37 FString ScriptGetFirstFilename() const
38 {
39 //TODO make sure this work at runtime
40#if WITH_EDITORONLY_DATA
41 return GetFirstFilename();
42#else
43 return FString();
44#endif
45 }
46
50 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
51 TArray<FString> ScriptExtractFilenames() const
52 {
53 //TODO make sure this work at runtime
54#if WITH_EDITORONLY_DATA
55 return ExtractFilenames();
56#else
57 return TArray<FString>();
58#endif
59 }
60
64 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
65 TArray<FString> ScriptExtractDisplayLabels() const
66 {
68 //TODO make sure this work at runtime
69#if WITH_EDITORONLY_DATA
71#endif
72 return TempDisplayLabels;
73 }
74
75#if WITH_EDITORONLY_DATA
76#if WITH_EDITOR
77 UE_DEPRECATED(5.4, "Implement the version that takes FAssetRegistryTagsContext instead.")
78 virtual void AppendAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) override
79 {
81 Super::AppendAssetRegistryTags(OutTags);
83 }
84
88 virtual void AppendAssetRegistryTags(FAssetRegistryTagsContext Context) override
89 {
90 if(const UInterchangeBaseNodeContainer* NodeContainerTmp = GetNodeContainer())
91 {
92 if (NodeContainerTmp->IsNodeUidValid(NodeUniqueID))
93 {
94 if (const UInterchangeBaseNode* Node = GetStoredNode(NodeUniqueID))
95 {
98 Node->AppendAssetRegistryTags(DeprecatedFunctionTags);
100 {
101 Context.AddTag(MoveTemp(Tag));
102 }
104 Node->AppendAssetRegistryTags(Context);
105 }
106 }
107 }
108 Super::AppendAssetRegistryTags(Context);
109 }
110#endif
111#endif
112
114 UPROPERTY(EditAnywhere, Category = "Interchange | AssetImportData")
115 FSoftObjectPath SceneImportAsset;
116
119 {
120 if (Object)
121 {
122 TArray<UObject*> SubObjects;
123 GetObjectsWithOuter(Object, SubObjects);
124 for (UObject* SubObject : SubObjects)
125 {
127 {
128 return AssetImportData;
129 }
130 }
131 }
132
133 return nullptr;
134 }
135
137 UPROPERTY(VisibleAnywhere, Category = "Interchange | AssetImportData")
138 FString NodeUniqueID;
139
140
141 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
143
144 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
146
150 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
151 INTERCHANGEENGINE_API TArray<UObject*> GetPipelines() const;
152
153 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
154 INTERCHANGEENGINE_API int32 GetNumberOfPipelines() const;
155
156 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
157 INTERCHANGEENGINE_API void SetPipelines(const TArray<UObject*>& InPipelines);
158
159
160 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
161 INTERCHANGEENGINE_API const UInterchangeBaseNode* GetStoredNode(const FString& InNodeUniqueId) const;
162
163 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
164 INTERCHANGEENGINE_API UInterchangeFactoryBaseNode* GetStoredFactoryNode(const FString& InNodeUniqueId) const;
165
166 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
167 INTERCHANGEENGINE_API const UInterchangeTranslatorSettings* GetTranslatorSettings() const;
168
169 UFUNCTION(BlueprintCallable, Category = "Interchange | AssetImportData")
171
173 INTERCHANGEENGINE_API void BackupSourceData() const;
174 INTERCHANGEENGINE_API void ClearBackupSourceData() const;
175 INTERCHANGEENGINE_API void ReinstateBackupSourceData();
176
177private:
178 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use GetNodeContainer/SetNodeContainer instead."))
179 TObjectPtr<UInterchangeBaseNodeContainer> NodeContainer_DEPRECATED;
180 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use GetPipelines/SetPipelines instead."))
181 TArray<TObjectPtr<UObject>> Pipelines_DEPRECATED;
182
184 mutable TObjectPtr<UInterchangeBaseNodeContainer> TransientNodeContainer;
185
187 mutable TArray<TObjectPtr<UObject>> TransientPipelines;
188
190 mutable TObjectPtr<UInterchangeTranslatorSettings> TransientTranslatorSettings;
191
192 void ProcessContainerCache() const;
193 void ProcessPipelinesCache() const;
194 void ProcessDeprecatedData() const;
195 void ProcessTranslatorCache() const;
196 mutable TArray64<uint8> CachedNodeContainer;
197 mutable TArray<TPair<FString, FString>> CachedPipelines; //Class, Data(serialized JSON) pair
198 mutable FCustomVersionContainer CachedCustomVersions; // Custom versions of the archive we deserialized from, to help us deserialize our cached data
199 mutable TPair<FString, FString> CachedTranslatorSettings;
200
201#if WITH_EDITORONLY_DATA
204#endif
205 // #todo_interchange: TODO: Move to as a IntercnageManager utility method
206 static TMap<FString, UClass*> GetPipelineClassPerName();
207};
208
212UCLASS(Abstract, MinimalAPI)
214{
216public:
217
218 /* Converter must return which class they can convert to and from UInterchangeAssetImportData. */
219 virtual bool CanConvertClass(const UClass* SourceClass, const UClass* DestinationClass) const { return false; }
220
230 virtual bool ConvertImportData(UObject* Asset, const FString& TargetExtension) const
231 {
232 return false;
233 }
234
242 {
243 return false;
244 }
245};
#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
#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 UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
void GetObjectsWithOuter(const class UObjectBase *Outer, TArray< UObject * > &Results, bool bIncludeNestedObjects, EObjectFlags ExclusionFlags, EInternalObjectFlags ExclusionInternalFlags)
Definition UObjectHash.cpp:1551
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition AssetRegistryTagsContext.h:98
Definition CustomVersion.h:111
Definition UnrealType.h:3087
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition AssetImportData.h:72
Definition Class.h:3793
Definition InterchangeAssetImportData.h:214
virtual bool CanConvertClass(const UClass *SourceClass, const UClass *DestinationClass) const
Definition InterchangeAssetImportData.h:219
virtual bool ConvertImportData(const UObject *SourceImportData, const UClass *DestinationClass, UObject **DestinationImportData) const
Definition InterchangeAssetImportData.h:241
virtual bool ConvertImportData(UObject *Asset, const FString &TargetExtension) const
Definition InterchangeAssetImportData.h:230
Definition InterchangeAssetImportData.h:21
Definition InterchangeBaseNodeContainer.h:39
Definition InterchangeBaseNode.h:195
Definition InterchangeFactoryBaseNode.h:188
Definition InterchangePipelineBase.h:217
Definition InterchangeTranslatorBase.h:33
Definition Object.h:95
Definition AssetImportData.h:15
Definition SoftObjectPath.h:56
Definition ObjectPtr.h:488
Definition Tuple.h:652
Definition Object.h:827