Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions editor/file_system/editor_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down