For the complete documentation index, see llms.txt. This page is also available as Markdown.

Asset Import Processor API

The Asset Importer plugin allows you to add support for your own runtime file formats.

Instead of replacing the entire import pipeline, you can register an Asset Import Processor that handles one or more file extensions while automatically integrating with Runtime Studio's existing import workflow.

Imported assets automatically benefit from:

  • Import Review

  • duplicate detection

  • Project panel integration

  • save and load

  • export and import

  • runtime asset libraries

Overview

The primary extension point is:

IAssetImportProcessor

Create a processor when you want Runtime Studio to recognize and import your own file formats.

The built-in importers included with the Asset Importer plugin also use this processor system.

How the Import Pipeline Works

When a file is imported, Runtime Studio performs the following steps:

  1. Creates a RuntimeAssetImportRequest.

  2. Searches all registered IAssetImportProcessor instances.

  3. Calls CanImport(...) on each processor.

  4. Uses the highest-priority processor that returns true.

  5. Imports one or more RuntimeImportedAsset objects.

  6. Displays the results in the Import Review window.

  7. Imports the approved assets into the runtime Project panel.

This means custom processors automatically integrate with Runtime Studio's normal import workflow.

Creating Your First Import Processor

A processor only requires three things:

  • identify the file types it supports

  • import the file

  • return one or more RuntimeImportedAsset objects

Minimal example:

Registering Your Processor

The recommended approach is through an IEditorModule.

Registering an AssetImportFileType makes your format appear automatically in the Runtime Studio file picker and WebGL file browser.

Direct registry registration is also supported if required.

Returning Multiple Assets

A single source file can produce multiple imported assets.

Common examples include:

  • models

  • materials

  • textures

  • animation clips

  • meshes

  • archive files

When importing multiple assets from the same source file:

  • use a shared sourceId

  • assign each imported asset a unique resultId

This allows Runtime Studio to correctly restore imported assets after loading a save.

Working with Sidecar Files

Many formats reference additional files such as:

  • .mtl

  • textures

  • binary payloads

  • metadata files

These can be accessed from the import request.

When distributing assets, packaging everything inside a .zip is generally the most reliable workflow.

Useful Runtime Classes

The Asset Importer exposes several helper classes that can be useful when building custom importers.

RuntimeImportedAssetManager

Handles parsing and importing runtime assets.

Useful methods include:

  • TryImportBytes(...)

  • TryImportRequest(...)

  • AddImportedAssets(...)

AssetImportProcessorRegistry

Registers and manages import processors.

AssetImportFileTypeRegistry

Registers file extensions that should appear in the Runtime Studio file picker.

RuntimeAssetImporterRegistry

Reports whether a file type is supported by the current importer pipeline.

Processor IDs

Processors expose two identifiers.

ProcessorId

Identifies the processor registration.

Changing this only affects registration.

ImporterId

Identifies imported assets saved by your processor.

This value is written into Runtime Studio save data.

Once your importer has shipped, do not change the ImporterId, otherwise previously imported assets may no longer restore correctly.

Last updated