UFactory::CreateOrOverwriteAsset

Creates an asset if it doesn't exist.

Windows
MacOS
Linux

References

Module

UnrealEd

Header

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

Include

#include "Factories/Factory.h"

Source

/Engine/Source/Editor/UnrealEd/Private/Factories/Factory.cpp

Syntax

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

Remarks

Creates an asset if it doesn't exist. If it does exist then it overwrites it if possible. If it can not overwrite then it will delete and replace. If it can not delete, it will return nullptr.

Returns

A pointer to a new asset of the specified type or null if the creation failed.

Parameters

Parameter

Description

InClass

The class of the asset to create

InPackage

The package to create this object within.

Name

The name to give the new asset. If no value (NAME_None) is specified, the asset will be given a unique name in the form of ClassName_#.

InFlags

The ObjectFlags to assign to the new asset.

Template

If specified, the property values from this object will be copied to the new object, and the new object's ObjectArchetype value will be set to this object. If nullptr, the class default object is used instead.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss