EditorImportPlugin
Imports custom source formats into editor resources.
Derive from EditorImportPlugin and register an instance through EditorPlugin.AddImportPlugin(). Declare a stable identifier, source extensions, output class and output extension. _Import() validates input, creates the resource and saves it at the supplied savePath with the appropriate extension. Return the actual read, conversion or save error.
The editor stores settings beside the source in .import and generated data in the project cache. Load through the source path, not a hard-coded cache filename. When disabling the plugin, call RemoveImportPlugin() with the same instance and release your owned reference.
Complete C# example and reimport.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
EditorImportPluginConstructor
public EditorImportPlugin();Methods15
AppendImportExternalResourceError
public Error AppendImportExternalResource(string path, Reckfell.Collections.Dictionary customOptions = null, string customImporter = "", Variant generatorParameters = default);Synchronously import an additional external resource during the current import process. Call from _Import(), for example for a generated image needing its own importer. Calls outside an import process are rejected; this is not a replacement for ordinary ReimportFiles().
| Name | Type | Default |
|---|---|---|
path | string | — |
customOptions | Reckfell.Collections.Dictionary | null |
customImporter | string | "" |
generatorParameters | Variant | default |
pathThe additional source resource path.
customOptionsImport option overrides; an empty dictionary by default.
customImporterThe stable identifier of a specific importer, or an empty string for normal selection.
generatorParametersExtra metadata stored as generator_parameters in the .import file remap section.
ErrorThe nested import result code.
_CanImportThreadedbool
public virtual bool _CanImportThreaded();Allow the importer to run on parallel threads. The default is false. Return true only when the handler and its dependencies are thread-safe; do not access the editor tree from worker threads.
booltrue for thread-safe parallel import; otherwise false.
_GetFormatVersionint
public virtual int _GetFormatVersion();Return this importer's generated-data format version; the default is 0. Increment it for incompatible output changes. This is not the engine version or the plugin display name.
intThe integer importer format version.
_GetImportOptionsReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public virtual Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetImportOptions(string path, int presetIndex);Return preset settings as an array of dictionaries. Each requires name and default_value; property_hint, hint_string and usage are optional. The default_value type determines the property type; a range hint does not replace validation in _Import().
| Name | Type | Default |
|---|---|---|
path | string | — |
presetIndex | int | — |
pathThe source path whose options are being requested.
presetIndexThe initial-value preset index; this callback is also used without declared presets.
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>An array of option dictionaries, or an empty array when there are no options.
_GetImportOrderint
public virtual int _GetImportOrder();Set importer execution order: smaller values run first. The default is 0. Use this for dependency ordering, not for choosing between importers for the same extension.
intThe numerical import order.
_GetImporterNamestring
public virtual string _GetImporterName();Return a unique stable importer identifier. It is stored in .import and used for reimport; _GetVisibleName() controls the display label.
stringAn identifier such as reckfell.docs.rgb_material.
_GetOptionVisibilitybool
public virtual bool _GetOptionVisibility(string path, StringName optionName, Reckfell.Collections.Dictionary options);Determine whether an option is visible in the Import dock using current options. All options are visible by default. Hiding a field does not remove its value or replace validation in _Import().
| Name | Type | Default |
|---|---|---|
path | string | — |
optionName | StringName | — |
options | Reckfell.Collections.Dictionary | — |
pathThe source file path.
optionNameThe option name, matching its name key.
optionsCurrent import option values.
booltrue to show the option; false to hide it.
_GetPresetCountint
public virtual int _GetPresetCount();Return the number of initial option presets. The default is no presets (0); _GetImportOptions() must still return a valid array.
intThe number of presets.
_GetPresetNamestring
public virtual string _GetPresetName(int presetIndex);Return a readable preset name for an index declared by _GetPresetCount().
| Name | Type | Default |
|---|---|---|
presetIndex | int | — |
presetIndexA preset index from 0 to _GetPresetCount() - 1.
stringThe selected preset name.
_GetPriorityfloat
public virtual float _GetPriority();Set preference when automatically selecting an importer for a source extension. Higher values are preferred; the default is 1.0. The import system also uses an identifier already stored in .import and explicit per-file selection.
floatThe numerical importer priority.
_GetRecognizedExtensionsstring[]
public virtual string[] _GetRecognizedExtensions();Return source extensions without dots. Matching is case-insensitive. Prefer a custom extension to avoid capturing ordinary project files.
string[]An extension array such as ["rfcolor"].
_GetResourceTypestring
public virtual string _GetResourceType();Return the class name of the imported resource, such as StandardMaterial3D. This is the output class, not the source extension.
stringA Reckfell resource type name.
_GetSaveExtensionstring
public virtual string _GetSaveExtension();Return the generated primary resource extension without a dot. For ordinary import, _Import() must save the resource at savePath + "." + this extension.
stringThe output extension, for example material.
_GetVisibleNamestring
public virtual string _GetVisibleName();Return a readable label for importer selection in the Import dock. Changing the label does not require changing the stable identifier.
stringThe importer display name.
_ImportError
public virtual Error _Import(string sourceFile, string savePath, Reckfell.Collections.Dictionary options, Reckfell.Collections.Array<string> platformVariants, Reckfell.Collections.Array<string> genFiles);Convert the source file and save the primary resource at savePath + "." + _GetSaveExtension(). Validate input and return any read, conversion or save error. Populate platformVariants and genFiles only for variants and additional files actually created.
| Name | Type | Default |
|---|---|---|
sourceFile | string | — |
savePath | string | — |
options | Reckfell.Collections.Dictionary | — |
platformVariants | Reckfell.Collections.Array<string> | — |
genFiles | Reckfell.Collections.Array<string> | — |
sourceFileThe source file path in the project.
savePathThe editor-supplied output base path without an extension. Do not replace it with a hard-coded cache path.
optionsImport setting values; do not rely solely on the UI to validate types and ranges.
platformVariantsOutput array of feature tags for saved variants at savePath + "." + tag + "." + extension. Leave empty when there are no variants.
genFilesOutput array of full asset:// paths to additional generated dependencies. The ordinary primary output does not need to be listed here.
ErrorError.Ok only after successful import and saving; otherwise an error code.