EditorSceneFormatImporter
继承: RefCounted < Object
派生: EditorSceneFormatImporterBlend, EditorSceneFormatImporterFBX2GLTF, EditorSceneFormatImporterGLTF, EditorSceneFormatImporterUFBX
从第三方的 3D 文件中导入场景。
描述
EditorSceneFormatImporter 允许为第三方 3D 格式定义导入器脚本。
要使用 EditorSceneFormatImporter,请先使用 EditorPlugin.add_scene_format_importer_plugin() 方法注册它。
方法
_get_extensions() virtual required const |
|
void |
_get_import_options(path: String) virtual |
_get_option_visibility(path: String, for_animation: bool, option: String) virtual const |
|
_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() 中调用。