UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InterchangeTranslatorBase.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
7#include "CoreMinimal.h"
8#include "CoreTypes.h"
9#include "InterchangeResult.h"
14#include "UObject/Object.h"
16#include "UObject/ObjectPtr.h"
18
19#include "InterchangeTranslatorBase.generated.h"
20
22
23namespace UE::Interchange
24{
25 struct FAnalyticsHelper;
26}
27
31UCLASS(BlueprintType, Blueprintable, editinlinenew, Abstract, MinimalAPI)
33{
35
36public:
37 UFUNCTION(BlueprintCallable, Category = "Interchange")
38 INTERCHANGECORE_API void LoadSettings();
39
40 UFUNCTION(BlueprintCallable, Category = "Interchange")
41 INTERCHANGECORE_API void SaveSettings();
42};
43
44UENUM(BlueprintType)
46{
47 Invalid = 0,
48 Assets = 1 << 1,
49 Actors = 1 << 2,
51};
52
53UENUM(BlueprintType)
55{
56 None = 0x0,
57 Textures = 0x1 << 0,
58 Materials = 0x1 << 1,
59 Meshes = 0x1 << 2,
60 Animations = 0x1 << 3,
61 Sounds = 0x1 << 4,
62 Grooms = 0x1 << 5,
63};
65
66UCLASS(BlueprintType, Blueprintable, Abstract, MinimalAPI)
68{
70public:
71
73 UFUNCTION(BlueprintCallable, Category = "Interchange | Translator")
74 INTERCHANGECORE_API virtual bool CanImportSourceData(const UInterchangeSourceData* InSourceData) const;
75
81 virtual bool IsThreadSafe() const { return true; }
82
84 UFUNCTION(BlueprintCallable, Category = "Interchange | Translator")
86
87 bool DoesSupportAssetType(EInterchangeTranslatorAssetType AssetType) const { return EnumHasAllFlags(GetSupportedAssetTypes(), AssetType); }
88
89 UFUNCTION(BlueprintCallable, Category = "Interchange | Translator")
91
93 UFUNCTION(BlueprintCallable, Category = "Interchange | Translator")
94 virtual TArray<FString> GetSupportedFormats() const PURE_VIRTUAL(UInterchangeTranslatorBase::GetSupportedExtensions, return TArray<FString>(););
95
102 virtual bool Translate(UInterchangeBaseNodeContainer& BaseNodeContainer) const
103 {
104 return false;
105 }
106
113 virtual void ReleaseSource()
114 {
115 return;
116 }
117
122 virtual void ImportFinish()
123 {
124 return;
125 }
126
130 template <typename T>
131 T* AddMessage() const
132 {
133 if (ensure(Results) && ensure(SourceData))
134 {
135 T* Item = Results->Add<T>();
136 Item->SourceAssetName = SourceData->GetFilename();
137 return Item;
138 }
139 return nullptr;
140 }
141
143 {
144 if (ensure(Results) && ensure(SourceData))
145 {
146 Results->Add(Item);
147 Item->SourceAssetName = SourceData->GetFilename();
148 }
149 }
150
155
159 UFUNCTION(BlueprintCallable, Category = "Interchange | Translator")
160 const UInterchangeSourceData* GetSourceData() const
161 {
162 return SourceData;
163 }
164
168 UFUNCTION(BlueprintCallable, Category = "Interchange | Translator")
169 virtual UInterchangeTranslatorSettings* GetSettings() const { return nullptr; }
170
174 UFUNCTION(BlueprintCallable, Category = "Interchange | Translator")
176
177 UPROPERTY()
179
180 UPROPERTY()
182
183 TSharedPtr<UE::Interchange::FAnalyticsHelper> AnalyticsHelper = nullptr;
184};
#define ensure( InExpression)
Definition AssertionMacros.h:464
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
D3D12_DESCRIPTOR_HEAP_TYPE Translate(ERHIDescriptorHeapType InHeapType)
Definition D3D12Descriptors.h:19
constexpr bool EnumHasAllFlags(Enum Flags, Enum Contains)
Definition EnumClassFlags.h:28
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
EInterchangeTranslatorType
Definition InterchangeTranslatorBase.h:46
EInterchangeTranslatorAssetType
Definition InterchangeTranslatorBase.h:55
#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
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Array.h:670
Definition SharedPointer.h:692
Definition InterchangeBaseNodeContainer.h:39
Definition InterchangeResult.h:33
FString SourceAssetName
Definition InterchangeResult.h:65
Definition InterchangeResultsContainer.h:21
Definition InterchangeSourceData.h:23
Definition InterchangeTranslatorBase.h:68
T * AddMessage() const
Definition InterchangeTranslatorBase.h:131
virtual void ImportFinish()
Definition InterchangeTranslatorBase.h:122
virtual void ReleaseSource()
Definition InterchangeTranslatorBase.h:113
void AddMessage(UInterchangeResult *Item) const
Definition InterchangeTranslatorBase.h:142
bool DoesSupportAssetType(EInterchangeTranslatorAssetType AssetType) const
Definition InterchangeTranslatorBase.h:87
virtual bool IsThreadSafe() const
Definition InterchangeTranslatorBase.h:81
void SetResultsContainer(UInterchangeResultsContainer *InResults)
Definition InterchangeTranslatorBase.h:151
Definition InterchangeTranslatorBase.h:33
Definition Object.h:95
Definition InterchangeHelper.cpp:9
Definition AdvancedWidgetsModule.cpp:13
Definition ObjectPtr.h:488