diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-31 13:48:42 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-31 13:48:42 +0200 |
commit | 5914023be957ee39490b141da9c2cfe9362f6d62 (patch) | |
tree | 14660edbde1b32cd5e00f18ed08b988db697fc06 /editor | |
parent | 8d9a394f63f9b8c40c804085f1c2dd7af13519f3 (diff) | |
download | redot-engine-5914023be957ee39490b141da9c2cfe9362f6d62.tar.gz |
Fix reimporting textures after changing import project settings
Fixes #94882.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_system.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 412d60f931..a99e1dc731 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -438,7 +438,7 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo Error err; Ref<FileAccess> f = FileAccess::open(p_path + ".import", FileAccess::READ, &err); - if (f.is_null()) { //no import file, do reimport + if (f.is_null()) { // No import file, reimport. return true; } @@ -472,10 +472,15 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo break; } else if (err != OK) { ERR_PRINT("ResourceFormatImporter::load - '" + p_path + ".import:" + itos(lines) + "' error '" + error_text + "'."); - return false; //parse error, try reimport manually (Avoid reimport loop on broken file) + // Parse error, skip and let user attempt manual reimport to avoid reimport loop. + return false; } if (!assign.is_empty()) { + if (assign == "valid" && value.operator bool() == false) { + // Invalid import (failed previous import), skip and let user attempt manual reimport to avoid reimport loop. + return false; + } if (assign.begins_with("path")) { to_check.push_back(value); } else if (assign == "files") { @@ -502,6 +507,11 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo } } + if (!ResourceFormatImporter::get_singleton()->are_import_settings_valid(p_path)) { + // Reimport settings are out of sync with project settings, reimport. + return true; + } + if (importer_name == "keep" || importer_name == "skip") { return false; //keep mode, do not reimport } |