Merge pull request #59472 from KoBeWi/data_migration

Make resource unique when pasting to another scene
This commit is contained in:
Rémi Verschelde 2022-03-25 09:15:45 +01:00 committed by GitHub
commit 277333bd24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -327,6 +327,13 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
case OBJ_MENU_PASTE: {
edited_resource = EditorSettings::get_singleton()->get_resource_clipboard();
if (edited_resource->is_built_in() && EditorNode::get_singleton()->get_edited_scene() &&
edited_resource->get_path().get_slice("::", 0) != EditorNode::get_singleton()->get_edited_scene()->get_scene_file_path()) {
// Automatically make resource unique if it belongs to another scene.
_edit_menu_cbk(OBJ_MENU_MAKE_UNIQUE);
return;
}
emit_signal(SNAME("resource_changed"), edited_resource);
_update_resource();
} break;