You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add a "keep" import mode to keep files as-is and export them.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user