FDatasmithImportContext

Choose your operating system:

Windows

macOS

Linux

References

Module

DatasmithImporter

Header

/Engine/Plugins/Enterprise/DatasmithImporter/Source/DatasmithImporter/Public/DatasmithImportContext.h

Include

#include "DatasmithImportContext.h"

Syntax

struct FDatasmithImportContext

Variables

Name Description

Public variable

FDatasmithActor...

 

ActorsContext

Actors specific import context

Public variable

TArray< TStrong...

 

AdditionalImportOptions

Per-Translator settings related to the import of a Datasmith scene

Public variable

FDatasmithAsset...

 

AssetsContext

Assets specific import context

Public variable

bool

 

bImportedViaScript

Public variable

bool

 

bIsAReimport

Public variable

TAtomic< bool >

 

bUserCancelled

Indicates if the user has canceled the import process

Public variable

TSharedPtr< voi...

 

ContextExtension

Generic extension

Public variable

FFeedbackContex...

 

FeedbackContext

Feedback context provided by ImportFactory. Used to display import progress

Public variable

FMD5Hash

 

FileHash

Cached MD5 hash value for faster processing

Public variable

TSharedPtr< IDa...

 

FilteredScene

IDatasmithScene object filtered with only what will actually go through the import process

Public variable

TArray< USceneC...

 

Hierarchy

Stack of parent components we're currently importing under

Public variable

TMap< TSharedRe...

 

ImportedLevelSequences

Map of imported level sequences for each level sequence element

Public variable

TMap< TSharedRe...

 

ImportedLevelVariantSets

Map of imported level variant sets for each level variant set element

Public variable

TMap< TSharedRe...

 

ImportedMaterialFunctions

Map of imported material function for each material element, they are only imported as a per-required basis

Public variable

TMap< FString, ...

 

ImportedMaterialFunctionsByName

Register IDatasmithMeshElement by their name so they can be searched faster

Public variable

TMap< TSharedRe...

 

ImportedMaterials

Map of imported material for each material element

Public variable

TMap< uint32, U...

 

ImportedParentMaterials

List of potential parent materials with their hash. Used to create material instances from.

Public variable

TMap< TSharedRe...

 

ImportedStaticMeshes

Map of imported mesh for each mesh element

Public variable

TMap< FString, ...

 

ImportedStaticMeshesByName

Register IDatasmithMeshElement by their name so they can be searched faster

Public variable

TMap< TSharedRe...

 

ImportedTextures

Map of imported texture for each texture element

Public variable

EObjectFlags

 

ObjectFlags

Object flags to apply to newly imported objects

Public variable

TStrongObjectPt...

 

Options

Settings related to the import of a Datasmith scene

Public variable

TSet< FString >

 

ParsedIesFiles

List of previously parsed IES files

Public variable

TSharedPtr< IDa...

 

Scene

IDatasmithScene object requested to be imported to UE editor

Public variable

UDatasmithScene...

 

SceneAsset

Scene asset

Public variable

FString

 

SceneName

Name of the scene being created

Public variable

TSharedPtr< IDa...

 

SceneTranslator

Name of the scene being created

Constructors

Name Description

Public function

FDatasmithImportContext

(
    const TSharedPtr< UE::DatasmithImpo...,
    bool bLoadConfig,
    const FName& LoggerName,
    const FText& LoggerLabel
)

Public function

FDatasmithImportContext

(
    const FString& InFileName,
    bool bLoadConfig,
    const FName& LoggerName,
    const FText& LoggerLabel,
    TSharedPtr< IDatasmithTranslator > ...
)

Please use constructor using ExternalSource

Functions

Name Description

Public function

void

 

AddImportedActor

(
    AActor* InActor
)

Add newly created Actor to context's map

Public function

void

 

AddSceneComponent

(
    const FString& InName,
    USceneComponent* InMeshCompone...
)

Add newly created SceneComponent to context's map

Public function

void

 

DisplayMessages()

Displays all the messages that were added through AddMessage in the MessageLogModule

Public function Const

TArray< AAct...

 

GetImportedActors()

Public function

bool

 

Init

(
    const FString& InImportPath,
    EObjectFlags InFlags,
    FFeedbackContext* InWarn,
    const TSharedPtr< FJsonObject >& I...,
    bool bSilent
)

Initialize members required before loading anything, must call InitScene() independendly when using this function.

Public function

bool

 

InitOptions

(
    const TSharedPtr< FJsonObject >& I...,
    const TOptional< FString >& InImpo...,
    bool bSilent
)

First part of the Init process, requires a call to SetupDestination and InitScene after that.

Public function

void

 

InitScene

(
    const TSharedRef< IDatasmithScene >...
)

Set the scene and initialize related members. Should be called before starting the import process.

Public function

TSharedRef< ...

 

LogError

(
    const FText& InErrorMessage
)

Push messages for display to the end-user

Public function

TSharedRef< ...

 

LogInfo

(
    const FText& InInfoMessage
)

Public function

TSharedRef< ...

 

LogWarning

(
    const FText& InWarningMessage,
    bool bPerformance
)

Public function

bool

 

SetupDestination

(
    const FString& InImportPath,
    EObjectFlags InFlags,
    FFeedbackContext* InWarn,
    bool bSilent
)

Second part of the Init process, replaces Init, requires a call to InitOptions before that.

Public function Const

bool

 

ShouldImportActors()

Public function

void

 

UpdateImportOption

(
    UDatasmithOptionsBase* Option
)

Replace or add options based on it's UClass.

Deprecated Functions

Name Description

Public function

 

FDatasmithImportContext

(
    const FString& InFileName,
    bool bLoadConfig,
    const FName& LoggerName,
    const FText& LoggerLabel,
    TSharedPtr< IDatasmithTranslator > ...
)

Please use constructor using ExternalSource

Public function

bool

 

Init

(
    TSharedRef< IDatasmithScene > InSce...,
    const FString& InImportPath,
    EObjectFlags InFlags,
    FFeedbackContext* InWarn,
    const TSharedPtr< FJsonObject >& I...,
    bool bSilent
)

The options initialization should not require a scene. Please use other implemetantion of Init() and call InitScene() individually.

Public function

bool

 

InitOptions

(
    TSharedRef< IDatasmithScene > InSce...,
    const TSharedPtr< FJsonObject >& I...,
    bool bSilent
)

Please use other InitOptions() implementations, having a valid scene should not be a requirement for initializing the options.