UFactory

Base class for all factories An object responsible for creating and importing new objects.

Windows
MacOS
Linux

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UFactory

PAPER2UPaperFlipbookFactory

UAlembicImportFactory

UAnimBlueprintFactory

UAnimLayerInterfaceFactory

UAnimCompositeFactory

UAnimCurveCompressionSettingsFactory

UAnimMontageFactory

UAnimSequenceFactory

UAnimStreamableFactory

UBehaviorTreeFactory

UBlackboardDataFactory

UBlendSpaceFactory1D

UAimOffsetBlendSpaceFactory1D

UBlendSpaceFactoryNew

UAimOffsetBlendSpaceFactoryNew

UBlueprintFactory

UBlueprintFunctionLibraryFactory

UBlueprintMacroFactory

UBlueprintInterfaceFactory

UCameraAnimFactory

UCanvasRenderTarget2DFactoryNew

UChaosPhysicalMaterialFactory

UChaosSolverFactory

UCompositeCurveTableFactory

UCSVImportFactory

UReimportCurveFactory

UReimportCurveTableFactory

UReimportDataTableFactory

UCurveFactory

UCurveFloatFactory

UCurveLinearColorFactory

UCurveVectorFactory

UCurveImportFactory

UCurveLinearColorAtlasFactory

UDataAssetFactory

UDataTableFactory

UCompositeDataTableFactory

UDialogueVoiceFactory

UDialogueWaveFactory

UEditorUtilityBlueprintFactory

UEditorUtilityWidgetBlueprintFactory

UEnumFactory

UEnvironmentQueryFactory

UFbxFactory

UReimportFbxAnimSequenceFactory

UReimportFbxSkeletalMeshFactory

UReimportFbxStaticMeshFactory

UFieldSystemFactory

UFontFactory

UFontFileImportFactory

UForceFeedbackAttenuationFactory

UForceFeedbackEffectFactory

UGameplayAbilitiesBlueprintFactory

UHapticFeedbackEffectBufferFactory

UHapticFeedbackEffectCurveFactory

UHapticFeedbackEffectSoundWaveFactory

UHoudiniCSVFactory

UInterpDataFactoryNew

UITDSpatializationSettingsFactory

ULevelFactory

ULightPropagationVolumeBlendableFactory

UMaterialFactoryNew

UMaterialFunctionFactoryNew

UMaterialFunctionInstanceFactory

UMaterialFunctionMaterialLayerBlendInstanceFactory

UMaterialFunctionMaterialLayerInstanceFactory

UMaterialFunctionMaterialLayerBlendFactory

UMaterialFunctionMaterialLayerFactory

UMaterialInstanceConstantFactoryNew

UMaterialParameterCollectionFactoryNew

UModelFactory

UModularSynthPresetBankFactory

UMonoWaveTableSynthPresetFactory

UNiagaraEmitterFactoryNew

UNiagaraParameterCollectionFactoryNew

UNiagaraParameterCollectionInstanceFactoryNew

UNiagaraScriptFactoryNew

UNiagaraDynamicInputScriptFactory

UNiagaraFunctionScriptFactory

UNiagaraModuleScriptFactory

UNiagaraSystemFactoryNew

UObjectLibraryFactory

UPackageFactory

UPackFactory

UPaperSpriteFactory

UPaperTiledImporterFactory

UPaperTileMapFactory

UPaperTileMapPromotionFactory

UPaperTileSetFactory

UParticleSystemFactoryNew

UPhysicalMaterialFactoryNew

UPhysicsAssetFactory

UPolysFactory

UPoseAssetFactory

UPreviewMeshCollectionFactory

UReverbEffectFactory

URuntimeVirtualTextureFactory

USceneImportFactory

UFbxSceneImportFactory

UReimportFbxSceneFactory

USkeletonFactory

USlateBrushAssetFactory

USlateVectorArtDataFactory

USlateWidgetStyleAssetFactory

USoundAttenuationFactory

USoundClassFactory

USoundConcurrencyFactory

USoundCueFactoryNew

USoundFactory

UReimportSoundFactory

USoundMixFactory

USoundModImporterFactory

USoundSourceBusFactory

USoundSourceEffectChainFactory

USoundSourceEffectFactory

USoundSubmixEffectFactory

USoundSubmixFactory

USoundSurroundFactory

UReimportSoundSurroundFactory

USpeedTreeImportFactory

UReimportSpeedTreeFactory

UStringTableFactory

UStructureFactory

USubsurfaceProfileFactory

USubUVAnimationFactory

UTexture2DFactoryNew

UTextureFactory

UReimportTextureFactory

UTrueTypeFontFactory

UTextureRenderTargetCubeFactoryNew

UTextureRenderTargetFactoryNew

UTimecodeSynchronizerFactory

UTimeSynthClipFactory

UTimeSynthVolumeGroupFactory

UTouchInterfaceFactory

UVectorFieldStaticFactory

UReimportVectorFieldStaticFactory

UVolumeTextureFactory

UWidgetBlueprintFactory

UWorldFactory

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Classes/Factories/Factory.h

Include

#include "Factories/Factory.h"

Syntax

class UFactory : public UObject

Remarks

Base class for all factories An object responsible for creating and importing new objects.

Variables

Name Description

Public variable

UAssetImportTas...

 

AssetImportTask

Task for importing file via script interfaces

Public variable

const UAutomate...

 

AutomatedImportData

Data for how to import files via the automated command line importing interface

Protected variable

uint32: 1

 

bCreateNew

The default value to return from CanCreateNew()

Public variable

uint32: 1

 

bEditAfterNew

True if the associated editor should be opened after creating a new object.

Public variable

uint32: 1

 

bEditorImport

True if the factory imports objects from files.

Public variable

uint32: 1

 

bText

True if the factory imports objects from text.

Public variable

TSubclassOf< UO...

 

ContextClass

Class of the context object used to help create the object.

Public variable

TArray< FString...

 

Formats

List of formats supported by the factory.

Public variable

int32

 

ImportPriority

Determines the order in which factories are tried when importing or reimporting an object.

Protected variable

int32

 

OverwriteYesOrNoToAllState

For interactive object imports, this value indicates whether the user wants objects to be automatically overwritten (See EAppReturnType), or -1 if the user should be prompted.

Public variable

TSubclassOf< UO...

 

SupportedClass

The class manufactured by this factory.

Constructors

Name Description

Public function

UFactory

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function Virtual Const

bool

 

CanCreateNew()

Public function Virtual

void

 

CleanUp()

Do clean up after importing is done. Will be called once for multi batch import.

Public function Virtual

bool

 

ConfigureProperties()

Opens a dialog to configure the factory properties.

Public function Const

UObject *...

 

CreateOrOverwriteAsset

(
    UClass* InClass,
    UObject* InParent,
    FName InName,
    EObjectFlags InFlags,
    UObject* InTemplate
)

Creates an asset if it doesn't exist.

Public function

void

 

DisplayOverwriteOptionsDialog

(
    const FText& Message
)

Pop up message to the user asking whether they wish to overwrite existing state or not.

Public function Virtual

bool

 

DoesSupportClass

(
    UClass* Class
)

Public function Virtual

bool

 

FactoryCanImport

(
    const FString& Filename
)

Whether the specified file can be imported by this factory.

Protected function Virtual

UObject *...

 

FactoryCreateBinary

(
    UClass* InClass,
    UObject* InParent,
    FName InName,
    EObjectFlags Flags,
    UObject* Context,
    const TCHAR* Type,
    const uint8*& Buffer,
    const uint8* BufferEnd,
    FFeedbackContext* Warn,
    bool& bOutOperationCanceled
)

Create a new object by importing it from a binary buffer (cancelable).

Protected function Virtual

UObject *...

 

FactoryCreateBinary

(
    UClass* InClass,
    UObject* InParent,
    FName InName,
    EObjectFlags Flags,
    UObject* Context,
    const TCHAR* Type,
    const uint8*& Buffer,
    const uint8* BufferEnd,
    FFeedbackContext* Warn
)

Create a new object by importing it from a binary buffer.

Public function Virtual

UObject *...

 

FactoryCreateFile

(
    UClass* InClass,
    UObject* InParent,
    FName InName,
    EObjectFlags Flags,
    const FString& Filename,
    const TCHAR* Parms,
    FFeedbackContext* Warn,
    bool& bOutOperationCanceled
)

Create a new object by importing it from a file name.

Public function Virtual

UObject *...

 

FactoryCreateNew

(
    UClass* InClass,
    UObject* InParent,
    FName InName,
    EObjectFlags Flags,
    UObject* Context,
    FFeedbackContext* Warn,
    FName CallingContext
)

Create a new object by class.

Public function Virtual

UObject *...

 

FactoryCreateNew

(
    UClass* InClass,
    UObject* InParent,
    FName InName,
    EObjectFlags Flags,
    UObject* Context,
    FFeedbackContext* Warn
)

Create a new object by class.

Protected function Virtual

UObject *...

 

FactoryCreateText

(
    UClass* InClass,
    UObject* InParent,
    FName InName,
    EObjectFlags Flags,
    UObject* Context,
    const TCHAR* Type,
    const TCHAR*& Buffer,
    const TCHAR* BufferEnd,
    FFeedbackContext* Warn,
    bool& bOutOperationCanceled
)

Create a new object by importing it from a text buffer.

Protected function Virtual

UObject *...

 

FactoryCreateText

(
    UClass* InClass,
    UObject* InParent,
    FName InName,
    EObjectFlags Flags,
    UObject* Context,
    const TCHAR* Type,
    const TCHAR*& Buffer,
    const TCHAR* BufferEnd,
    FFeedbackContext* Warn
)

Create a new object by importing it from a text buffer.

Public function Static

FString

 

GetCurrentFilename()

Get the name of the file currently being imported.

Public function Static

int32

 

GetDefaultImportPriority()

Get the default import priority for factories.

Public function Virtual Const

FString

 

GetDefaultNewAssetName()

Returns a new starting point name for newly created assets in the content browser

Public function Virtual Const

FText

 

GetDisplayName()

Returns the name of the factory for menus

Public function Static

FMD5Hash

 

GetFileHash()

Get the Hash for the file being imported.

Public function Virtual

IImportSetti...

 

GetImportSettingsParser()

Public function Virtual Const

uint32

 

GetMenuCategories()

When shown in menus, this is the category containing this factory.

Public function Virtual Const

FName

 

GetNewAssetThumbnailOverride()

Returns an optional override brush name for the new asset menu.

Public function Const

UClass *

 

GetSupportedClass()

Public function Const

void

 

GetSupportedFileExtensions

(
    TArray< FString >& OutExtensions
)

Creates a list of file extensions supported by this factory

Public function Virtual Const

FText

 

GetToolTip()

Returns the tooltip text description of this factory

Public function Virtual Const

FString

 

GetToolTipDocumentationExcerpt()

Returns the documentation excerpt that should be use for the rich tool tip for this factory

Public function Virtual Const

FString

 

GetToolTipDocumentationPage()

Returns the documentation page that should be use for the rich tool tip for this factory

Public function Virtual

UObject *...

 

ImportObject

(
    UClass* InClass,
    UObject* InOuter,
    FName InName,
    EObjectFlags Flags,
    const FString& Filename,
    const TCHAR* Parms,
    bool& OutCanceled
)

Public function Virtual

bool

 

ImportUntypedBulkDataFromText

(
    const TCHAR*& Buffer,
    FUntypedBulkData& BulkData
)

Public function Const

bool

 

IsAutomatedImport()

Public function

void

 

ResetState()

Resets the saved state of this factory.

Public function Virtual

UClass *

 

ResolveSupportedClass()

Resolves SupportedClass for factories which support multiple classes.

Public function

bool

 

ScriptFactoryCanImport

(
    const FString& Filename
)

Whether the specified file can be imported by this factory. (Implemented in script)

Public function

bool

 

ScriptFactoryCreateFile

(
    UAssetImportTask* InTask
)

Import object(s) using a task via script

Public function

void

 

SetAssetImportTask

(
    UAssetImportTask* Task
)

Sets the import task being used with this factory

Public function

void

 

SetAutomatedAssetImportData

(
    const UAutomatedAssetImportData...
)

Sets the automated import data being used with this factory

Public function Virtual Const

bool

 

ShouldShowInNewMenu()

Returns true if this factory should be shown in the New Asset menu (by default calls CanCreateNew).

Public function Static

bool

 

SortFactoriesByPriority

(
    const UFactory& A,
    const UFactory& B
)

Helper function to sort an array of factories by their import priority - use as a predicate for Sort

Public function Static

UObject *...

 

StaticImportObject

(
    UClass* Class,
    UObject* InOuter,
    FName Name,
    EObjectFlags Flags,
    const TCHAR* Filename,
    UObject* Context,
    UFactory* Factory,
    const TCHAR* Parms,
    FFeedbackContext* Warn,
    int32 MaxImportFileSize
)

Public function Static

UObject *...

 

StaticImportObject

(
    UClass* Class,
    UObject* InOuter,
    FName Name,
    EObjectFlags Flags,
    bool& bOutOperationCanceled,
    const TCHAR* Filename,
    UObject* Context,
    UFactory* Factory,
    const TCHAR* Parms,
    FFeedbackContext* Warn,
    int32 MaxImportFileSize
)

Constants

Name

Description

CurrentFilename

Name of the file currently being imported.

DefaultImportPriority

This is the import priority that all factories are given in the default constructor.

FileHash

This is the HASH for the file being imported

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback