WorksDocumentation

Create, Open, and Save Material Assets

Find and create assets

Use ListMaterials to find materials and material instances. The plugin can create both asset types. New assets start in editor memory.

Resolve editor changes and save

If the target is open in an asset editor, save or resolve changes there before using CloseAsset.

Write, compile, and save tools reject targets that are still open in an asset editor. This prevents the Material Editor’s transient preview and the backing asset from diverging, and prevents a later editor Apply operation from overwriting completed MCP changes.

Newly created assets remain dirty in memory until SaveAsset is called explicitly; an underlying save failure returns an MCP error terminal state instead of a warning inside a successful result.

Writes use transactions and mark the package dirty. Use CompileMaterial to check compilation before saving. You can save first and then use OpenAsset to inspect the result. If you open it before saving, close the asset editor again before you save.