1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Allow passing UID to importer

This helps, for importers spitting out new resources to the res://
filesystem to actually hash them to generate deterministic UIDs.

This PR also fixes the determinism for translations.
This commit is contained in:
Juan
2024-09-23 16:07:40 +02:00
committed by Rémi Verschelde
parent 0f5f3bc954
commit fe34c45d2a
38 changed files with 54 additions and 41 deletions

View File

@@ -2740,13 +2740,17 @@ Error EditorFileSystem::_reimport_file(const String &p_file, const HashMap<Strin
}
}
if (uid == ResourceUID::INVALID_ID) {
uid = ResourceUID::get_singleton()->create_id();
}
//finally, perform import!!
String base_path = ResourceFormatImporter::get_singleton()->get_import_base_path(p_file);
List<String> import_variants;
List<String> gen_files;
Variant meta;
Error err = importer->import(p_file, base_path, params, &import_variants, &gen_files, &meta);
Error err = importer->import(uid, p_file, base_path, params, &import_variants, &gen_files, &meta);
// As import is complete, save the .import file.
@@ -2767,10 +2771,6 @@ Error EditorFileSystem::_reimport_file(const String &p_file, const HashMap<Strin
f->store_line("type=\"" + importer->get_resource_type() + "\"");
}
if (uid == ResourceUID::INVALID_ID) {
uid = ResourceUID::get_singleton()->create_id();
}
f->store_line("uid=\"" + ResourceUID::get_singleton()->id_to_text(uid) + "\""); // Store in readable format.
if (err == OK) {