Skip to main content

Overview

The AssetDefinition class describes editor-related functionality for a specific asset type. Plugins can derive from this class to customize asset icons, override editors, and define import/export methods.

Registration

Register your asset definition using the RegisterAssetDefinitionAttribute in your plugin’s AssemblyInfo.cs:
The definition will be associated with the specified type and all derived types in the game’s type system.

Constructor

AssetDefinition

Initializes a new instance of the AssetDefinition class.

Virtual Methods

GetEditor

Returns a custom editor used to edit the asset. Must inherit from FrostyAssetEditor.
ILogger
required
The logging interface to use in the editor
FrostyAssetEditor
A custom asset editor instance, or null to use the default editor

GetIcon

Returns an icon for the asset type or a specific asset entry.
AssetEntry
The asset entry to generate an icon for
double
default:"PositiveInfinity"
Suggested width for the icon
double
default:"PositiveInfinity"
Suggested height for the icon
ImageSource
An ImageSource representing the icon, or null for default

GetSupportedExportTypes

Provides a list of valid export file types for the asset.
List<AssetExportType>
required
List to populate with supported export types
Default export types (if not overridden):
  • bin: Binary File
  • xml: XML File

GetSupportedImportTypes

Provides a list of valid import file types for the asset.
List<AssetImportType>
required
List to populate with supported import types
Default import types (if not overridden):
  • bin: Binary File (Data Only)
  • bin: Binary File

Export

Performs the actual export of the asset.
EbxAssetEntry
required
The asset entry to export
string
required
The full path and filename to export to
string
required
The file extension of the chosen export type
bool
True if export was successful, false otherwise

Import

Performs the actual import of data into the asset.
EbxAssetEntry
required
The asset entry to import data into
string
required
The full path and filename to import from
AssetImportType
required
The chosen import type containing extension and description
bool
True if import was successful, false otherwise

Helper Structures

AssetExportType

Represents an export file type.
string
File extension without the dot (e.g., “fbx”)
string
Human-readable description (e.g., “Autodesk FBX”)

AssetImportType

Represents an import file type.
string
File extension without the dot (e.g., “fbx”)
string
Human-readable description (e.g., “Autodesk FBX”)

Complete Example

See Also