You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Don't assign a uid when copying resource file whose importer name
is `keep` or `skip`
This commit is contained in:
@@ -3085,13 +3085,19 @@ Error EditorFileSystem::_copy_file(const String &p_from, const String &p_to) {
|
||||
return err;
|
||||
}
|
||||
|
||||
// Roll a new uid for this copied .import file to avoid conflict.
|
||||
ResourceUID::ID res_uid = ResourceUID::get_singleton()->create_id_for_path(p_to);
|
||||
|
||||
// Save the new .import file
|
||||
Ref<ConfigFile> cfg;
|
||||
cfg.instantiate();
|
||||
cfg->load(p_from + ".import");
|
||||
String importer_name = cfg->get_value("remap", "importer");
|
||||
|
||||
if (importer_name == "keep" || importer_name == "skip") {
|
||||
err = da->copy(p_from + ".import", p_to + ".import");
|
||||
return err;
|
||||
}
|
||||
|
||||
// Roll a new uid for this copied .import file to avoid conflict.
|
||||
ResourceUID::ID res_uid = ResourceUID::get_singleton()->create_id_for_path(p_to);
|
||||
cfg->set_value("remap", "uid", ResourceUID::get_singleton()->id_to_text(res_uid));
|
||||
err = cfg->save(p_to + ".import");
|
||||
if (err != OK) {
|
||||
|
||||
Reference in New Issue
Block a user