You've already forked godot
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user