mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Don't assign a uid when copying resource file whose importer name
is `keep` or `skip`
This commit is contained in:
parent
0fdbf050e0
commit
aed8f32e72
1 changed files with 9 additions and 3 deletions
|
|
@ -3085,13 +3085,19 @@ Error EditorFileSystem::_copy_file(const String &p_from, const String &p_to) {
|
||||||
return err;
|
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
|
// Save the new .import file
|
||||||
Ref<ConfigFile> cfg;
|
Ref<ConfigFile> cfg;
|
||||||
cfg.instantiate();
|
cfg.instantiate();
|
||||||
cfg->load(p_from + ".import");
|
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));
|
cfg->set_value("remap", "uid", ResourceUID::get_singleton()->id_to_text(res_uid));
|
||||||
err = cfg->save(p_to + ".import");
|
err = cfg->save(p_to + ".import");
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue