unreal.InterchangeManager

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

Bases: Object

Interchange Manager

C++ Source:

  • Module: InterchangeEngine

  • File: InterchangeManager.h

can_reimport(object) Array[str] or None

Returns true if Interchange can create this type of asset and is able to translate its source files.

Parameters:

object (Object) – The object we want to reimport.

Returns:

out_filenames (Array[str]): An array that is filled with the object’s source filenames if the operation is successful.

Return type:

Array[str] or None

can_translate_source_data(source_data, scene_import_only=False) bool

Check whether there is a registered translator for this source data. This allows us to bypass the original asset tools system to import supported assets. Note:: Temporary until FBX level import is production ready

Parameters:
Returns:

True if there is a registered translator that can handle handle this source data, or false otherwise, when bSceneImportOnly is false. Otherwise, returns true only if the translator supports level import

Return type:

bool

cancel_all_tasks() None

This function cancels all tasks and finishes them as fast as possible. We use this if the user cancels the work or if the editor exits. note: This is a asynchronous call. Tasks will be completed (canceled) soon.

classmethod create_source_data(file_name) InterchangeSourceData
  • Script helper to create a source data object that points to a file on disk.

return:: A new UInterchangeSourceData.

Parameters:

file_name (str)

Return type:

InterchangeSourceData

export_asset(asset, is_automated=False) bool

Call this to start an asset export process. The caller must specify a source data.

Parameters:
  • asset (Object) – The asset to export.

  • is_automated (bool) – If true, the exporter will not show any UI or dialogs.

Returns:

true if the export succeeds, or false otherwise.

Return type:

bool

export_scene(world, is_automated=False) bool

Call this to start a scene export process. The caller must specify a source data.

Parameters:
  • world (Object) – The scene to export.

  • is_automated (bool) – If true, the import process will not show any UI or dialogs.

Returns:

true if the export succeeds, or false otherwise.

Return type:

bool

get_asset_import_data(asset) InterchangeAssetImportData

Returns the list of supported formats for a given translator type.

Parameters:

asset (Object)

Return type:

InterchangeAssetImportData

classmethod get_interchange_manager_scripted() InterchangeManager

Return the pointer to the Interchange Manager singleton. note: We need to return a pointer to have a valid Blueprint-callable function.

Return type:

InterchangeManager

get_registered_factory_class(class_to_make)

Script helper to get a registered factory for a specified class. return:: The registered factory class if found, or NULL if no registered factory was found.

Parameters:

class_to_make (type(Class))

Return type:

type(Class)

get_supported_asset_type_formats(for_translator_asset_type, for_translator_type=InterchangeTranslatorType.INVALID, strict_match_translator_type=False) Array[str]

Returns the list of formats supporting the specified translator asset type.

Parameters:
Return type:

Array[str]

get_supported_formats(for_translator_type) Array[str]

Returns the list of supported formats for a given translator type.

Parameters:

for_translator_type (InterchangeTranslatorType)

Return type:

Array[str]

get_supported_formats_for_object(object, source_file_index) Array[str]

Returns the list of supported formats for a given Object.

Parameters:
  • object (Object)

  • source_file_index (int32)

Return type:

Array[str]

get_translator_for_source_data(source_data) InterchangeTranslatorBase
  • Return the first translator that can translate the source data.

Parameters:

source_data (InterchangeSourceData) – The source data that you want a translator for. *

Returns:

return a matching translator, or nullptr if no translators exist for the source data.

Return type:

InterchangeTranslatorBase

import_asset(content_path, source_data, import_asset_parameters) Array[Object] or None

Call this to start a synchronous asset import process. This process can import many different assets into the game content. Note: In blueprint depending on the event you use to start the import its possible to have a deadlock, use the async function if its what you are experimenting

Parameters:
  • content_path (str) – The path where the imported assets will be created.

  • source_data (InterchangeSourceData) – The source data input to translate.

  • import_asset_parameters (ImportAssetParameters) – All parameters that need to be passed to the import asset function.

Returns:

true if the import succeeds, or false otherwise.

out_imported_objects (Array[Object]):

Return type:

Array[Object] or None

import_scene(content_path, source_data, import_asset_parameters) bool

Call this to start a synchronous scene import process. This process can import many different assets and their transforms (USceneComponent). Note: In blueprint depending on the event you use to start the import its possible to have a deadlock, use the async function if its what you are experimenting

Parameters:
  • content_path (str) – The path where the imported assets will be created.

  • source_data (InterchangeSourceData) – The source data input to translate. This object will be duplicated to allow thread-safe operations.

  • import_asset_parameters (ImportAssetParameters) – All parameters that need to be passed to the import asset function.

Returns:

true if the import succeeds, or false otherwise.

Return type:

bool

is_interchange_active() bool

Return true if Interchange is actively importing or exporting, or false otherwise.

Return type:

bool

is_object_being_imported(object) bool

Return true if the object is being imported, or false otherwise. If the user imports multiple file in the same folder, it’s possible to have the same asset name in two different files.

Parameters:

object (Object)

Return type:

bool

reimport_asset(object_to_reimport, import_asset_parameters) Array[Object] or None

Call this to start a synchronous asset re-import process. This process can re-import many different assets into the game content. Note: The interchange manager will by default use the last file use to re-import the ObjectToReimport. If the file doesn’t exist and the bAutomated flag is: - true, the function will return false and log a warning - false, a dialog will ask Note: In blueprint depending on the event you use to start the import its possible to have a deadlock, use the async function if its what you are experimenting

Parameters:
  • object_to_reimport (Object) – The object to re-import.

  • import_asset_parameters (ImportAssetParameters) – All parameters that need to be passed to the import asset function.

Returns:

true if the import succeeds, or false otherwise.

out_imported_objects (Array[Object]):

Return type:

Array[Object] or None

scripted_import_asset_async(content_path, source_data, import_asset_parameters) bool

Call this from blueprint or python to start an asynchronous asset import process. This process can import many different assets into the game content.

Parameters:
  • content_path (str) – The path where the imported assets will be created.

  • source_data (InterchangeSourceData) – The source data input to translate.

  • import_asset_parameters (ImportAssetParameters) – All parameters that need to be passed to the import asset function.

Returns:

true if the import was started, or false otherwise.

Return type:

bool

scripted_import_scene_async(content_path, source_data, import_asset_parameters) bool

Call this to start a asynchronous scene import process. This process can import many different assets and their transforms (USceneComponent).

Parameters:
  • content_path (str) – The path where the imported assets will be created.

  • source_data (InterchangeSourceData) – The source data input to translate. This object will be duplicated to allow thread-safe operations.

  • import_asset_parameters (ImportAssetParameters) – All parameters that need to be passed to the import asset function.

Returns:

true if the import was started, or false otherwise.

Return type:

bool

scripted_reimport_asset_async(object_to_reimport, import_asset_parameters) bool

Call this from blueprint or python to start an asynchronous asset import process. This process can import many different assets into the game content. Note: The interchange manager will by default use the last file use to re-import the ObjectToReimport. If the file doesn’t exist and the bAutomated flag is: - true, the function will return false and log a warning - false, a dialog will ask Note: If you need an event for when the import is done use the ImportAssetParameters events.

Parameters:
  • object_to_reimport (Object) – The object to re-import.

  • import_asset_parameters (ImportAssetParameters) – All parameters that need to be passed to the import asset function.

Returns:

true if the import was started, or false otherwise.

Return type:

bool

wait_until_all_tasks_done(cancel) None

Wait synchronously until all tasks are done.

Parameters:

cancel (bool)

warn_if_interchange_is_active() bool

Return false if Interchange is not actively importing or exporting. If Interchange is active, it will display a notification to let the user know they can cancel the asynchronous import/export to be able to complete the operation they requested. (This is called by the exit editor operation.)

Return type:

bool