1
0
Fork 0

Move reimport check to EditorImportPlugin

reimport_append is used by gltf_document, fbx_document and editor_import_plugin. The first two will never call it when importing == false. It's only the editor_import_plugin that should guard against that.
https://docs.godotengine.org/en/stable/classes/class_editorimportplugin.html#class-editorimportplugin-method-append-import-external-resource

The motivation of removing the check from gltf_document call path is to be able to test nested imports (texture embedded in gltf).
This commit is contained in:
demolke 2024-11-30 00:05:05 +01:00
parent fafc07335b
commit 143d8c87bb
2 changed files with 1 additions and 1 deletions

View File

@ -3205,7 +3205,6 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
} }
Error EditorFileSystem::reimport_append(const String &p_file, const HashMap<StringName, Variant> &p_custom_options, const String &p_custom_importer, Variant p_generator_parameters) { Error EditorFileSystem::reimport_append(const String &p_file, const HashMap<StringName, Variant> &p_custom_options, const String &p_custom_importer, Variant p_generator_parameters) {
ERR_FAIL_COND_V_MSG(!importing, ERR_INVALID_PARAMETER, "Can only append files to import during a current reimport process.");
Vector<String> reloads; Vector<String> reloads;
reloads.append(p_file); reloads.append(p_file);

View File

@ -214,6 +214,7 @@ Error EditorImportPlugin::_append_import_external_resource(const String &p_file,
} }
Error EditorImportPlugin::append_import_external_resource(const String &p_file, const HashMap<StringName, Variant> &p_custom_options, const String &p_custom_importer, Variant p_generator_parameters) { Error EditorImportPlugin::append_import_external_resource(const String &p_file, const HashMap<StringName, Variant> &p_custom_options, const String &p_custom_importer, Variant p_generator_parameters) {
ERR_FAIL_COND_V_MSG(!EditorFileSystem::get_singleton()->is_importing(), ERR_INVALID_PARAMETER, "Can only append files to import during a current reimport process.");
return EditorFileSystem::get_singleton()->reimport_append(p_file, p_custom_options, p_custom_importer, p_generator_parameters); return EditorFileSystem::get_singleton()->reimport_append(p_file, p_custom_options, p_custom_importer, p_generator_parameters);
} }