Skip to content

Commit

Permalink
Move reimport check to EditorImportPlugin
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
demolke committed Nov 30, 2024
1 parent 40876f9 commit b7644a0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion editor/editor_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
ERR_FAIL_COND_V_MSG(!importing, ERR_INVALID_PARAMETER, "Can only append files to import during a current reimport process.");
Vector<String> reloads;
reloads.append(p_file);

Expand Down
1 change: 1 addition & 0 deletions editor/import/editor_import_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,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) {
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);
}

Expand Down

0 comments on commit b7644a0

Please sign in to comment.