Interchange¶
16 tools for Interchange imports: pipelines, translators and factories, importing and reimporting, and resetting imported actors and levels.
Back to the index.
can_reset_interchange_actor¶
Read-only
Check, without changing anything, whether an Interchange reset (restoring an imported actor to what its Interchange scene import produced) can run on one actor of the editor world (UInterchangeEditorScriptLibrary::CanResetActor). can_reset is true only when the Interchange.FeatureFlags.InterchangeReset console variable is on and a component of the actor carries Interchange asset user data (for a Level Instance, its map's world settings do; that map is loaded to check). false is a normal answer, not an error. Use it before reset_interchange_actors, which skips the actors that fail this check without saying which; for a whole map use can_reset_interchange_world and reset_interchange_level_asset; to see what an asset's import recorded, get_interchange_asset_import_data. An actor that is not found is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_path |
string | yes | Full object path of the actor (e.g. "/Game/Maps/MyMap.MyMap:PersistentLevel.ActorName_0") or its object name in the persistent level of the editor world (e.g. "StaticMeshActor_3"); labels are not matched. |
Returns: { actor_path: string, can_reset: bool }
can_reset_interchange_world¶
Read-only
Report, read-only, whether Interchange can reset a world (UInterchangeEditorScriptLibrary::CanResetWorld): the map asset world_path names, loaded if needed, or the current editor world. Returns can_reset, is_editor_world and resolved_world_path. Run the reset with reset_interchange_level_asset.
| Parameter | Type | Required | Description |
|---|---|---|---|
world_path |
string | no | World asset path (e.g. "/Game/Maps/MyMap") or fully-qualified object path. Empty = current editor world. |
Returns: { world_path: string, can_reset: bool, is_editor_world: bool }
can_translate_interchange_source_data¶
Read-only
Checks whether a translator registered with this editor's Interchange framework can read a source file, judged for most formats by the file extension alone: true means import_interchange_asset can try it, not that the file exists or will import cleanly. Read-only: nothing is imported, loaded or changed. It answers false, not an error, when Interchange import is disabled, the extension is blocked for import in the project, or no translator matches. Use it as a pre-flight check before import_interchange_asset; get_interchange_supported_formats lists every supported extension, and register_interchange_translator adds a reader for a new format.
| Parameter | Type | Required | Description |
|---|---|---|---|
file_path |
string | yes | Path of the source file, absolute on disk (e.g. "C:/Assets/Mesh.fbx", "D:/Scans/room.gltf"); for most translators only its extension is looked at, so the file need not exist yet. |
scene_only |
boolean | no | When true, answer true only when the matching translator is a scene translator (one that imports actors into a level, not only assets). Defaults to false (any translator type). |
Returns: { file_path: string, scene_only: bool, can_translate: bool }
create_interchange_pipeline_asset¶
Additive Idempotent
Create an Interchange pipeline asset of a concrete pipeline class (the generic texture, mesh, material, animation, audio, scenes, groom or assets pipelines, glTF, sparse volume texture, MaterialX). Idempotent: an object of that name already in package_path is returned with already_existed:true.
| Parameter | Type | Required | Description |
|---|---|---|---|
pipeline_class_path |
string | yes | Class path of the concrete (non-abstract) UInterchangePipelineBase subclass to instantiate (e.g. "/Script/InterchangePipelines.InterchangeGenericAssetsPipeline"), loaded via LoadClass. |
asset_name |
string | yes | Name of the new pipeline asset (the object/package name under package_path). |
package_path |
string | no | Destination UE content folder for the new pipeline asset (e.g. "/Game/Pipelines"). Defaults to "/Game". |
Returns: { pipeline_path: string, class: string, already_existed: bool, note: string }
get_interchange_asset_import_data¶
Read-only
Read the Interchange import data (UInterchangeAssetImportData) of an asset loaded by package or object path: its source_filenames, display_labels, the pipeline objects stored on it (class, name, object path of each) and whether it holds a node container; with include_node_container, also that container's root_uids and every factory node (uid, display_label and the class of the object that factory produces) -- what an Interchange import produced. An asset imported through the legacy factory path, or never imported, has none: that answers present=false with zeros and empty lists, a normal state and not an error; only a path that does not load is an error. Read-only: it writes nothing and needs no PIE. The legacy UAssetImportData of a factory import (source file and timestamp): get_asset_import_data; replace the pipeline stack: set_interchange_pipelines; reimport from this data: reimport_interchange_asset.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Asset path (e.g. "/Game/Foo/Foo") or fully-qualified object path ("/Game/Foo/Foo.Foo") |
include_node_container |
boolean | no | Optional bool, default false: add root_uids, factory_node_count and factory_nodes from the import data's node container (empty when there is none) |
Returns: { asset_path: string, present: bool, pipelines_count: number, pipelines: [{ class: string, name: string, path: string }], has_node_container: bool, source_filenames: [string], display_labels: [string], root_uids?: [string], factory_node_count?: number, factory_nodes?: [{ uid: string, class: string, display_label: string }] }
get_interchange_supported_formats¶
Read-only
Report Interchange framework availability and list the file extensions supported by registered Interchange translators of a given type. Calls UInterchangeManager::GetSupportedFormats(EInterchangeTranslatorType) (InterchangeManager.h, INTERCHANGEENGINE_API) and IsInterchangeImportEnabled(). The 5.8 enum has Invalid / Assets / Actors / Scenes (Scenes = Assets|Actors). Accepts aliases "Assets", "Actors", "Scenes", and "AssetsAndScene" (mapped to Scenes). The registered translator set is private in 5.8, so availability is reported as enabled (= import enabled AND at least one supported asset format) with the per-type format counts.
| Parameter | Type | Required | Description |
|---|---|---|---|
translator_type |
string | no | Translator type: "Assets" [default], "Actors", "Scenes", or the spec alias "AssetsAndScene" |
Returns: { translator_type: string, format_count: number, formats: [string], enabled: bool, import_enabled: bool, asset_format_count: number, actor_format_count: number, scene_format_count: number }
import_interchange_asset¶
Destructive
Import a source file synchronously through the Interchange manager: unattended, no dialogs, replacing existing assets unless replace_existing is false. When the InterchangeImport plugin is not loaded the note says so.
| Parameter | Type | Required | Description |
|---|---|---|---|
file_path |
string | yes | Path of the source file to import on disk (e.g. "C:/Assets/Mesh.fbx"). Passed to UInterchangeManager::CreateSourceData. |
destination_path |
string | no | Destination UE content folder for the imported asset(s) (e.g. "/Game/Meshes"). Defaults to "/Game/Imported". |
replace_existing |
boolean | no | When true, overwrite an existing asset at the destination (bReplaceExisting). Defaults to true. |
Returns: { file_path: string, destination_path: string, imported: bool, count: number, imported_objects: [string], note: string }
register_interchange_factory¶
Additive Idempotent
Register a factory class -- the Interchange step that creates one kind of asset, such as a texture or a static mesh, from translated data -- with the Interchange manager for this editor session. Nothing is written to disk and the registration ends when the editor closes; the engine registers its own factories on startup, so this is for a class whose plugin did not. The manager keeps one factory per asset class and the first one registered stays: when another factory already makes that asset class the call is refused and names it. Registering the factory that is already active changes nothing and reports already_registered=true, so a repeat call is harmless (idempotent). A class that does not load, is abstract or is not a UInterchangeFactoryBase subclass is refused. The reader of a source file format registers with register_interchange_translator.
| Parameter | Type | Required | Description |
|---|---|---|---|
factory_class_path |
string | yes | Class path of the factory class, e.g. "/Script/InterchangeImport.InterchangeTextureFactory"; loaded with LoadClass. |
Returns: { factory_class_path, class, asset_class, registered, already_registered }
register_interchange_translator¶
Additive Idempotent
Register a translator class -- the Interchange reader of one or more source file formats -- with the Interchange manager for this editor session, so imports and get_interchange_supported_formats pick up its formats. Nothing is written to disk and the registration ends when the editor closes; the engine registers its own translators on startup, so this is for a class whose plugin did not. The class must load and be a concrete UInterchangeTranslatorBase subclass: anything else is refused before it is registered, since the manager would assert on the next format query. A class already registered changes nothing and reports already_registered=true, so a repeat call is harmless (idempotent). A factory, which turns translated data into assets, registers with register_interchange_factory; whether a given file can be read: can_translate_interchange_source_data.
| Parameter | Type | Required | Description |
|---|---|---|---|
translator_class_path |
string | yes | Class path of the translator class, e.g. "/Script/InterchangeImport.InterchangeImageWrapperTranslator"; loaded with LoadClass. |
Returns: { translator_class_path, class, registered, already_registered?, supported_formats: [string] }
reimport_interchange_asset¶
Destructive
Reimports an asset that was imported through Interchange, from the source file and pipeline stack stored on its Interchange import data, synchronously and without dialogs: the asset's content in memory is overwritten with the file's current content. This tool does not save it (save_asset writes it). An asset without Interchange import data -- a legacy-importer asset, or one never imported -- is an error and nothing changes: use reimport_asset for those. Check which kind an asset has, and its source file, with get_interchange_asset_import_data; change the stored pipelines first with set_interchange_pipelines. A reimport that brings nothing back -- the stored source file is gone, does not translate, or has an extension no registered translator reads -- makes success false, with reimported false, count 0 and an error naming the stored source file; the editor log has the translator's reason.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Package path (e.g. "/Game/Meshes/SM_Rock") or object path ("/Game/Meshes/SM_Rock.SM_Rock") of the asset to reimport; it is loaded if needed. |
Returns: { asset_path: string, reimported: bool, count: number, note: string } -- reimported is true when the engine ran the reimport and handed back at least one object (count)
reset_interchange_actors¶
Destructive Idempotent
Run an Interchange reset (UInterchangeEditorScriptLibrary::ResetActors) on the editor-world actors listed by object path or persistent-level object name; the library skips actors that fail CanResetActor, and the reply does not say which were reset. Returns count, resolved and unresolved_paths. Check first with can_reset_interchange_actor.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_paths |
array | yes | Actors to reset, each a full object path (e.g. "/Game/Maps/MyMap.MyMap:PersistentLevel.ActorName_0") or an object name in the persistent level; labels are not matched, and empty or unknown entries land in unresolved_paths. |
Returns: { count: number, resolved: number, unresolved_paths: [string], note: string }
reset_interchange_level_asset¶
Destructive Idempotent
Run an Interchange reset on a level (UInterchangeEditorScriptLibrary::ResetLevelAsset), the map world_path names or the current editor world, only when the Interchange.FeatureFlags.InterchangeReset CVar is on and CanResetWorld is true; otherwise it does nothing and the call fails (reset false, with the reason in note). It does not save. Returns reset, can_reset, cvar_enabled and a note.
| Parameter | Type | Required | Description |
|---|---|---|---|
world_path |
string | no | World asset path (e.g. "/Game/Maps/MyMap") or fully-qualified object path. Empty = current editor world. |
Returns: { world_path: string, resolved_world_path: string, reset: bool, can_reset: bool, cvar_enabled: bool, note: string }
reset_interchange_scene_import_asset¶
Destructive Idempotent
Call the Interchange reset of a UInterchangeSceneImportAsset (UInterchangeEditorScriptLibrary::ResetSceneImportAsset); other asset classes are refused. The engine only resets while the Interchange.FeatureFlags.InterchangeReset CVar is 1: with it at 0 the call does nothing and fails (reset false). The reset itself returns nothing, so reset true means it ran, not what it changed. Use reset_interchange_level_asset for a level.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Asset path of the UInterchangeSceneImportAsset (e.g. "/Game/Imports/MyScene.MyScene") |
Returns: { asset_path: string, reset: bool, cvar_enabled: bool, note: string }
save_interchange_pipeline¶
Destructive Idempotent
Write the package of an Interchange pipeline asset (a UInterchangePipelineBase loaded by object path) over its .uasset on disk, dirty or not, through the shared asset save; saved false makes success false and save_error carries the measured cause. It is the persist step after create_interchange_pipeline_asset and set_properties, which change memory only; repeating it is idempotent. Like save_asset it refuses during PIE and under a read-only root. A path that does not load as a pipeline is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
pipeline_path |
string | yes | Object path of the pipeline asset whose package is written to disk (loaded via LoadObject, must be a UInterchangePipelineBase). |
Returns: { pipeline_path: string, file_path: string, saved: bool, save_error?: string }
set_interchange_pipeline_stack_default¶
Destructive Idempotent
Choose the named pipeline stack Interchange uses by default for content imports (assets) or scene imports (levels) -- the DefaultPipelineStack that Project Settings > Interchange shows -- and write it to the project's DefaultEngine.ini, so it outlives the editor session. The stack must already exist in that import path's pipeline stacks: an unknown name is refused with the list of the ones there, and so is a read-only DefaultEngine.ini, both before anything changes. The previous default is overwritten and returned in previous_stack_name; choosing the stack that is already the default changes nothing (changed=false), so a repeat call is harmless (idempotent). No undo step is recorded. The content stacks and both current defaults are read with get_properties on /Script/InterchangeEngine.Default__InterchangeProjectSettings; to choose the pipelines of one imported asset instead, use set_interchange_pipelines.
| Parameter | Type | Required | Description |
|---|---|---|---|
content_or_scene |
string | yes | Which default to set: "content" for asset imports (ContentImportSettings) or "scene" for level imports (SceneImportSettings). Case-insensitive. |
stack_name |
string | yes | Name of an existing pipeline stack of that import path, e.g. "Assets"; matched without case. |
Returns: { content_or_scene, stack_name, previous_stack_name, changed, config_file, applied }
set_interchange_pipelines¶
Destructive Idempotent
Replace the UInterchangePipelineBase stack on an asset's UInterchangeAssetImportData. Loads the asset + its UInterchangeAssetImportData, resolves each path in pipeline_paths via LoadObject<UObject>, then calls ID->SetPipelines(InPipelines) (InterchangeAssetImportData.h, INTERCHANGEENGINE_API). Idempotent: SetPipelines resets TransientPipelines before applying (impl InterchangeAssetImportData.cpp). Marks the package dirty so the change persists on save.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Asset path (e.g. "/Game/Foo/Foo") |
pipeline_paths |
array | yes | Array of fully-qualified pipeline asset paths (UObject* resolved via LoadObject). Entries that fail to resolve are reported in unresolved_paths but do not abort the call. |
Returns: { asset_path: string, present: bool, pipeline_count: number, unresolved_paths: [string] }