Skip to content

USMAssetImporter

Module: SMAssetTools

Inherits from UObject

Inherited by USMAssetImporterJson

Public Classes

Name
struct FImportArgs
struct FImportResult

Public Types

Name
enum uint8 EImportStatus

Public Functions

Name
EImportStatus ReadImportFile(const FString & InFilePath, const FImportArgs & InImportArgs)
EImportStatus ReadImportData(void * InData, const FImportArgs & InImportArgs)
USMBlueprint * CreateBlueprint(const FImportArgs & InImportArgs)
EImportStatus ImportCDO(UObject * InCDO)
EImportStatus ImportRootGraph(USMGraph * InGraph)
void FinishImport(USMBlueprint * InBlueprint, EImportStatus InStatus)

Protected Functions

Name
virtual EImportStatus OnReadImportFile(const FString & InFilePath, const FImportArgs & InImportArgs)
virtual EImportStatus OnReadImportData(void * InData, const FImportArgs & InImportArgs)
virtual void OnGetBlueprintCreationArgs(const FImportArgs & InImportArgs, ISMAssetManager::FCreateStateMachineBlueprintArgs & InOutCreationArgs)
virtual EImportStatus OnImportCDO(UObject * InCDO)
virtual EImportStatus OnImportRootGraph(USMGraph * InGraph)
virtual void OnFinishImport(USMBlueprint * InBlueprint, EImportStatus InStatus)

Public Types Documentation

enum EImportStatus

Enumerator Value Description
Success
Failure

Public Functions Documentation

function ReadImportFile

EImportStatus ReadImportFile(
    const FString & InFilePath,
    const FImportArgs & InImportArgs
)

function ReadImportData

EImportStatus ReadImportData(
    void * InData,
    const FImportArgs & InImportArgs
)

function CreateBlueprint

USMBlueprint * CreateBlueprint(
    const FImportArgs & InImportArgs
)

function ImportCDO

EImportStatus ImportCDO(
    UObject * InCDO
)

function ImportRootGraph

EImportStatus ImportRootGraph(
    USMGraph * InGraph
)

function FinishImport

void FinishImport(
    USMBlueprint * InBlueprint,
    EImportStatus InStatus
)

Protected Functions Documentation

function OnReadImportFile

inline virtual EImportStatus OnReadImportFile(
    const FString & InFilePath,
    const FImportArgs & InImportArgs
)

Called prior to other methods so the source file can be validated and opened. This can prevent a blueprint being created or an existing blueprint graph destroyed if the input file isn't valid.

This is not called if raw import data is used instead.

Parameters:

InFilePath
The file path of the file to be imported.
InImportArgs
The import args are not guaranteed to be filled out.

Return: The status of the import. Returning Failure will prevent processing from continuing.


function OnReadImportData

inline virtual EImportStatus OnReadImportData(
    void * InData,
    const FImportArgs & InImportArgs
)

Called prior to other methods so the source data can be validated and read. This can prevent a blueprint being created or an existing blueprint graph destroyed if the input file isn't valid.

This is not called if a file path is being used instead.

Parameters:

InData
Raw data to be read.
InImportArgs
The import args are not guaranteed to be filled out.

Return: The status of the import. Returning Failure will prevent processing from continuing.


function OnGetBlueprintCreationArgs

inline virtual void OnGetBlueprintCreationArgs(
    const FImportArgs & InImportArgs,
    ISMAssetManager::FCreateStateMachineBlueprintArgs & InOutCreationArgs
)

Create a blueprint for use with import. Only called if no blueprint was passed into the original import call. This method is not necessary to overload if the parent class doesn't need to change.

Parameters:

InImportArgs
The import args are not guaranteed to be filled out.
InOutCreationArgs
The creation args to use when creating a new blueprint.

function OnImportCDO

inline virtual EImportStatus OnImportCDO(
    UObject * InCDO
)

Called when the class defaults are being imported.

Parameters:

InCDO
The class default object.

Return: The status of the import. Returning Failure will prevent processing from continuing.


function OnImportRootGraph

inline virtual EImportStatus OnImportRootGraph(
    USMGraph * InGraph
)

Called when the root graph is being imported. All sub graphs should be created at this stage.

Parameters:

InGraph
The root state machine graph.

Return: The status of the import. Returning Failure will prevent processing from continuing.


function OnFinishImport

inline virtual void OnFinishImport(
    USMBlueprint * InBlueprint,
    EImportStatus InStatus
)

Called after all other import methods have finished.

Parameters:

InBlueprint
The blueprint being imported.
InStatus
The final status of the import.