Table of Contents

Class EditorSceneFormatImporter

Imports scenes from third-parties' 3D files.

Inheritance
EditorSceneFormatImporter
Derived

Remarks

EditorSceneFormatImporter allows to define an importer script for a third-party 3D format.

To use EditorSceneFormatImporter, register it using the EditorPlugin.add_scene_format_importer_plugin method first.

Fields

IMPORT_SCENE

const IMPORT_SCENE = 1

IMPORT_ANIMATION

const IMPORT_ANIMATION = 2

IMPORT_FAIL_ON_MISSING_DEPENDENCIES

const IMPORT_FAIL_ON_MISSING_DEPENDENCIES = 4

IMPORT_GENERATE_TANGENT_ARRAYS

const IMPORT_GENERATE_TANGENT_ARRAYS = 8

IMPORT_USE_NAMED_SKIN_BINDS

const IMPORT_USE_NAMED_SKIN_BINDS = 16

IMPORT_DISCARD_MESHES_AND_MATERIALS

const IMPORT_DISCARD_MESHES_AND_MATERIALS = 32

IMPORT_FORCE_DISABLE_MESH_COMPRESSION

const IMPORT_FORCE_DISABLE_MESH_COMPRESSION = 64

Methods

_get_extensions

Qualifiers: virtualconst

Return supported file extensions for this scene importer.

PackedStringArray _get_extensions

_get_import_options(String)

Qualifiers: virtual

Override to add general import options. These will appear in the main import dock on the editor. Add options via EditorSceneFormatImporter.add_import_option and EditorSceneFormatImporter.add_import_option_advanced.

Note: All EditorSceneFormatImporter and EditorScenePostImportPlugin instances will add options for all files. It is good practice to check the file extension when path is non-empty.

When the user is editing project settings, path will be empty. It is recommended to add all options when path is empty to allow the user to customize Import Defaults.

void _get_import_options(String path)

Parameters

path String

_get_option_visibility(String, bool, String)

Qualifiers: virtualconst

Should return true to show the given option, false to hide the given option, or null to ignore.

Variant _get_option_visibility(String path, bool for_animation, String option)

Parameters

path String
for_animation bool
option String

_import_scene(String, int, Dictionary)

Qualifiers: virtual

Perform the bulk of the scene import logic here, for example using GLTFDocument or FBXDocument.

Object _import_scene(String path, int flags, Dictionary options)

Parameters

path String
flags int
options Dictionary

add_import_option(String, Variant)

Add a specific import option (name and default value only). This function can only be called from EditorSceneFormatImporter._get_import_options.

void add_import_option(String name, Variant value)

Parameters

name String
value Variant

add_import_option_advanced(int, String, Variant, int, String, int)

Add a specific import option. This function can only be called from EditorSceneFormatImporter._get_import_options.

void add_import_option_advanced(int type, String name, Variant default_value, int hint, String hint_string, int usage_flags)

Parameters

type int
name String
default_value Variant
hint int
hint_string String
usage_flags int