UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Exporter.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
9#pragma once
10
11#include "CoreMinimal.h"
13#include "UObject/Object.h"
15#include "Exporter.generated.h"
16
18class UActorComponent;
20
21UCLASS(abstract, transient, MinimalAPI)
23{
25
26
27 UPROPERTY(BlueprintReadWrite, Category=Misc)
28 TSubclassOf<class UObject> SupportedClass;
29
35 TObjectPtr<class UObject> ExportRootScope; // transient
36
38 UPROPERTY(BlueprintReadWrite, Category=Misc)
39 TArray<FString> FormatExtension;
40
42 UPROPERTY(BlueprintReadWrite, Category=Misc)
43 TArray<FString> FormatDescription;
44
46 UPROPERTY()
47 int32 PreferredFormatIndex;
48
50 UPROPERTY()
51 int32 TextIndent;
52
54 UPROPERTY(BlueprintReadWrite, Category=Misc)
55 uint32 bText:1;
56
58 UPROPERTY()
59 uint32 bSelectedOnly:1;
60
62 UPROPERTY()
63 uint32 bForceFileOperations:1;
64
65 UPROPERTY(BlueprintReadWrite, Category=Misc)
67
68 ENGINE_API static FString CurrentFilename;
70 static const bool bEnableDebugBrackets;
71
72 //~ Begin UObject Interface.
73 ENGINE_API virtual void Serialize( FArchive& Ar ) override;
74 //~ End UObject Interface.
75
76 // Returns whether this exporter supports the specific object
77 ENGINE_API virtual bool SupportsObject(UObject* Object) const;
78
90 virtual bool ExportText( const class FExportObjectInnerContext* Context, UObject* Object, const TCHAR* Type, FOutputDevice& Ar, FFeedbackContext* Warn, uint32 PortFlags=0 ) { return( false );}
91
103 struct FExportPackageParams
104 {
105 FString RootMapPackageName;
107 UPackage* InPackage;
108 UObject* InObject;
109 const TCHAR* Type;
110 FOutputDevice* Ar;
112 uint32 PortFlags;
113 };
114
116 virtual void ExportPackageObject(FExportPackageParams& ExpPackageParams) {};
117
119 virtual void ExportPackageInners(FExportPackageParams& ExpPackageParams) {};
120
132 virtual bool ExportBinary( UObject* Object, const TCHAR* Type, FArchive& Ar, FFeedbackContext* Warn, int32 FileIndex = 0, uint32 PortFlags=0 ) { return( false );}
133
139 virtual int32 GetFileCount( UObject* Object ) const { return( 1 ); }
140
144 virtual FString GetUniqueFilename( UObject* Object, const TCHAR* Filename, int32 FileIndex, int32 FileCount ) const
145 {
146 check( FileIndex == 0 && FileCount == 1 );
147 return FString( Filename );
148 }
149
153 ENGINE_API virtual bool GetBatchMode() const;
154
158 ENGINE_API virtual void SetBatchMode(bool InBatchExportMode);
159
163 ENGINE_API virtual bool GetCancelBatch() const;
164
168 ENGINE_API virtual void SetCancelBatch(bool InCancelBatch);
169
173 ENGINE_API virtual bool GetShowExportOption() const;
174
178 ENGINE_API virtual void SetShowExportOption(bool InShowExportOption);
179
186 ENGINE_API static UExporter* FindExporter( UObject* Object, const TCHAR* Filetype );
187
201 ENGINE_API static int32 ExportToFile( UObject* Object, UExporter* Exporter, const TCHAR* Filename, bool InSelectedOnly, bool NoReplaceIdentical=false, bool Prompt=false );
202
213 ENGINE_API static bool ExportToArchive(UObject* Object, UExporter* Exporter, FArchive& Ar, const TCHAR* FileType, int32 FileIndex);
214
215
231 ENGINE_API static bool ExportToOutputDevice( const class FExportObjectInnerContext* Context, UObject* Object, UExporter* InExporter, FOutputDevice& Out, const TCHAR* FileType, int32 Indent, uint32 PortFlags=0, bool bInSelectedOnly=false, UObject* ExportRootScope = NULL);
232
233 struct FExportToFileParams
234 {
236 UExporter* Exporter;
237 const TCHAR* Filename;
238 bool InSelectedOnly;
239 bool NoReplaceIdentical;
240 bool Prompt;
241 bool bUseFileArchive;
242 TArray<UObject*> IgnoreObjectList;
243 bool WriteEmptyFiles;
244 };
245
254 UFUNCTION(BlueprintCallable, Category = "Miscellaneous")
255 static ENGINE_API bool RunAssetExportTask( class UAssetExportTask* Task );
256
264 UFUNCTION(BlueprintImplementableEvent, Category = "Miscellaneous")
265 bool ScriptRunAssetExportTask( class UAssetExportTask* Task );
266
275 UFUNCTION(BlueprintCallable, Category = "Miscellaneous")
276 static ENGINE_API bool RunAssetExportTasks( const TArray<UAssetExportTask*>& ExportTasks );
277
286 ENGINE_API void ExportObjectInner(const class FExportObjectInnerContext* Context, UObject* Object, FOutputDevice& Ar, uint32 PortFlags);
287
291 static ENGINE_API bool IsObjectSelectedForExport(const FExportObjectInnerContext* Context, const UObject* Object);
292
293protected:
303
311 ENGINE_API void EmitBeginObject( FOutputDevice& Ar, UObject* Obj, uint32 PortFlags );
312
319 ENGINE_API void EmitEndObject( FOutputDevice& Ar );
320
321protected:
324
327
330
333};
#define NULL
Definition oodle2base.h:134
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
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 UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition UnrealExporter.h:24
Definition FeedbackContext.h:30
Definition OutputDevice.h:133
Definition Array.h:670
Definition SubclassOf.h:30
Definition ActorComponent.h:152
Definition AssetExportTask.h:15
Definition Exporter.h:23
static TSet< TWeakObjectPtr< UExporter > > RegisteredExporters
Definition Exporter.h:323
bool CancelBatch
Definition Exporter.h:332
bool ShowExportOption
Definition Exporter.h:329
bool BatchExportMode
Definition Exporter.h:326
virtual void ExportComponentExtra(const FExportObjectInnerContext *Context, const TArray< UActorComponent * > &Components, FOutputDevice &Ar, uint32 PortFlags)
Definition Exporter.h:302
Definition Object.h:95
Definition Package.h:216
Definition ObjectPtr.h:488