EditorSceneFormatImporter

Наследует: RefCounted < Object

Наследуется от: EditorSceneFormatImporterBlend, EditorSceneFormatImporterFBX2GLTF, EditorSceneFormatImporterGLTF, EditorSceneFormatImporterUFBX

Импортирует сцены из сторонних 3D-файлов.

Описание

EditorSceneFormatImporter позволяет определить скрипт импортера для стороннего 3D-формата.

Чтобы использовать EditorSceneFormatImporter, сначала зарегистрируйте его с помощью метода EditorPlugin.add_scene_format_importer_plugin().

Методы

PackedStringArray

_get_extensions() virtual required const

void

_get_import_options(path: String) virtual

Variant

_get_option_visibility(path: String, for_animation: bool, option: String) virtual const

Object

_import_scene(path: String, flags: int, options: Dictionary) virtual required

void

add_import_option(name: String, value: Variant)

void

add_import_option_advanced(type: Variant.Type, name: String, default_value: Variant, hint: PropertyHint = 0, hint_string: String = "", usage_flags: int = 6)


Константы

IMPORT_SCENE = 1 🔗

There is currently no description for this constant. Please help us by contributing one!

IMPORT_ANIMATION = 2 🔗

There is currently no description for this constant. Please help us by contributing one!

IMPORT_FAIL_ON_MISSING_DEPENDENCIES = 4 🔗

There is currently no description for this constant. Please help us by contributing one!

IMPORT_GENERATE_TANGENT_ARRAYS = 8 🔗

There is currently no description for this constant. Please help us by contributing one!

IMPORT_USE_NAMED_SKIN_BINDS = 16 🔗

There is currently no description for this constant. Please help us by contributing one!

IMPORT_DISCARD_MESHES_AND_MATERIALS = 32 🔗

There is currently no description for this constant. Please help us by contributing one!

IMPORT_FORCE_DISABLE_MESH_COMPRESSION = 64 🔗

There is currently no description for this constant. Please help us by contributing one!


Описания метода

PackedStringArray _get_extensions() virtual required const 🔗

Верните поддерживаемые расширения файлов для этого импортера сцен.


void _get_import_options(path: String) virtual 🔗

Переопределите, чтобы добавить общие параметры импорта. Они появятся в главном доке импорта в редакторе. Добавьте параметры с помощью add_import_option() и add_import_option_advanced().

Примечание: Все экземпляры EditorSceneFormatImporter и EditorScenePostImportPlugin добавят параметры для всех файлов. Рекомендуется проверять расширение файла, если path непустой.

Когда пользователь редактирует настройки проекта, path будет пустым. Рекомендуется добавлять все параметры, если path пустой, чтобы пользователь мог настраивать параметры импорта по умолчанию.


Variant _get_option_visibility(path: String, for_animation: bool, option: String) virtual const 🔗

Должен возвращать true для отображения заданной опции, false для скрытия заданной опции или null для игнорирования.


Object _import_scene(path: String, flags: int, options: Dictionary) virtual required 🔗

Выполните здесь основную часть логики импорта сцены, например, с помощью GLTFDocument или FBXDocument.


void add_import_option(name: String, value: Variant) 🔗

Добавьте определенную опцию импорта (только имя и значение по умолчанию). Эту функцию можно вызвать только из _get_import_options().


void add_import_option_advanced(type: Variant.Type, name: String, default_value: Variant, hint: PropertyHint = 0, hint_string: String = "", usage_flags: int = 6) 🔗

Добавить конкретную опцию импорта. Эту функцию можно вызвать только из _get_import_options().