unreal.DatasmithSceneElement

class unreal.DatasmithSceneElement(outer: Object | None = None, name: Name | str = 'None')

Bases: DatasmithSceneElementBase

Datasmith Scene Element

C++ Source:

  • Plugin: DatasmithImporter

  • Module: DatasmithImporter

  • File: DatasmithBlueprintLibrary.h

classmethod construct_datasmith_scene_from_cad_files(file_paths) DatasmithSceneElement

Open set of CAD files as actors in a single datasmith scene Importing set of files into single DatasmithScene asset(with ImportScene) is supported only for CAD files

Parameters:

file_paths (Array[str]) –

Returns:

The opened DatasmithScene, that can be modified and can be imported.

Return type:

DatasmithSceneElement

classmethod construct_datasmith_scene_from_file(file_path) DatasmithSceneElement

Open an existing UDatasmith file from disk.

Parameters:

file_path (str) – UDatasmith file path to open. ie: c:/MyFolder/MyFiles.udatasmith

Returns:

The opened DatasmithScene, that can be modified and can be imported.

Return type:

DatasmithSceneElement

classmethod construct_datasmith_scene_from_source_uri(source_uri) DatasmithSceneElement

Open an existing Datasmith source from the SourceUri.

Parameters:

source_uri (str) – Uri of the datasmith scene to open. ie: file://c:/MyFolder/MyFiles.udatasmith

Returns:

The opened DatasmithScene, that can be modified and can be imported.

Return type:

DatasmithSceneElement

destroy_scene() None

Destroy reference to the udatasmith file. The Scene will no longer be available. DestroyScene is called automatically after ImportScene.

get_all_options() Map[type(Class), Object]

List all the options structures applicable on this scene

Returns:

A map of options type to option object

Return type:

Map[type(Class), Object]

classmethod get_existing_datasmith_scene(asset_path) DatasmithSceneElement

Open an existing DatasmithScene asset file from disk.

Parameters:

asset_path (str) – Path of the DFatasmithScene asset (eg. “/Game/MyAsset”)

Returns:

The opened DatasmithScene, that can be modified and can be reimported.

Return type:

DatasmithSceneElement

get_import_options() DatasmithImportOptions

Get Import Options deprecated: GetImportOptions is deprecated, use GetOptions instead.

Return type:

DatasmithImportOptions

get_options(option_type=None) Object

Fetch the typed options for this scene

Parameters:

option_type (type(Class)) – Type of the option structure to get

Returns:

The option structure found

Return type:

Object

import_scene(destination_folder) DatasmithImportFactoryCreateFileResult

Import a Datasmith Scene created with ConstructDatasmithSceneFromFile.

Parameters:

destination_folder (str) – Destination of where you want the asset to be imported. ie: /Game/MyFolder1

Returns:

A structure that contains the created actor or the blueprint actor depending of the options specified at the import.

Return type:

DatasmithImportFactoryCreateFileResult

import_scenes(destination_folder) Array[DatasmithImportFactoryCreateFileResult]

Import a Datasmith Scene created with ConstructDatasmithSceneFromFiles into an array of scenes.

Parameters:

destination_folder (str) – Destination of where you want the asset to be imported. ie: /Game/MyFolder1

Returns:

An array of import results corresponding to array of input files

Return type:

Array[DatasmithImportFactoryCreateFileResult]

reimport_scene() DatasmithImportFactoryCreateFileResult

Reimport a scene opened with GetExistingDatasmithScene

Returns:

A structure that contains the created actor or the blueprint actor depending of the options specified at the import.

Return type:

DatasmithImportFactoryCreateFileResult

translate_scene() bool

Trigger the translation phase, which populates the DatasmithScene. note that options should have been set before that and any modification to the scene made prior will be lost.

Return type:

bool