summaryrefslogtreecommitdiff
path: root/editor/editor_file_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r--editor/editor_file_system.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index dbbd762b5e..fb0dc57501 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -405,6 +405,10 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo
memdelete(f);
+ if (importer_name == "keep") {
+ return false; //keep mode, do not reimport
+ }
+
Ref<ResourceImporter> importer = ResourceFormatImporter::get_singleton()->get_importer_by_name(importer_name);
if (importer->get_format_version() > version) {
@@ -1532,6 +1536,10 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
source_file_options[p_files[i]] = Map<StringName, Variant>();
importer_name = file_importer_name;
+ if (importer_name == "keep") {
+ continue; //do nothing
+ }
+
Ref<ResourceImporter> importer = ResourceFormatImporter::get_singleton()->get_importer_by_name(importer_name);
ERR_FAIL_COND_V(!importer.is_valid(), ERR_FILE_CORRUPT);
List<ResourceImporter::ImportOption> options;
@@ -1555,6 +1563,10 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
base_paths[p_files[i]] = ResourceFormatImporter::get_singleton()->get_import_base_path(p_files[i]);
}
+ if (importer_name == "keep") {
+ return OK; // (do nothing)
+ }
+
ERR_FAIL_COND_V(importer_name == String(), ERR_UNCONFIGURED);
Ref<ResourceImporter> importer = ResourceFormatImporter::get_singleton()->get_importer_by_name(importer_name);
@@ -1700,7 +1712,7 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
params[E->get()] = cf->get_value("params", E->get());
}
}
- if (p_custom_importer != String() && cf->has_section("remap")) {
+ if (p_custom_importer == String() && cf->has_section("remap")) {
importer_name = cf->get_value("remap", "importer");
}
}
@@ -1710,6 +1722,16 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
late_added_files.insert(p_file); //imported files do not call update_file(), but just in case..
}
+ if (importer_name == "keep") {
+ //keep files, do nothing.
+ fs->files[cpos]->modified_time = FileAccess::get_modified_time(p_file);
+ fs->files[cpos]->import_modified_time = FileAccess::get_modified_time(p_file + ".import");
+ fs->files[cpos]->deps.clear();
+ fs->files[cpos]->type = "";
+ fs->files[cpos]->import_valid = false;
+ EditorResourcePreview::get_singleton()->check_for_invalidation(p_file);
+ return;
+ }
Ref<ResourceImporter> importer;
bool load_default = false;
//find the importer