summaryrefslogtreecommitdiff
path: root/editor/editor_resource_picker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_resource_picker.cpp')
-rw-r--r--editor/editor_resource_picker.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index a7b2a4cfa6..53f1a689d6 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -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;