Nodes: Add cut to context menu and remove shortcut

The node operator 'Cut' was assigned Ctrl+X as a default shortcut. After
some testing this proved to be problematic for the following use case:
- Copy nodes A and B
- Dissolve node C as a preparation for pasting A and B
- Paste
- => The dissolved node C is pasted instead of the expected A and B
  nodes.

This PR removes the shortcut, but keeps the operator accessible by
adding a new 'Cut' entry in the node context menu.

Note: the shortcut is not removed for the industry compatible keymap
because there are no conflicts with the dissolve operator there.

Pull Request: https://projects.blender.org/blender/blender/pulls/154522
This commit is contained in:
Habib Gahbiche 2026-02-23 15:51:26 +01:00
parent 6a12395de6
commit 99199bd193
2 changed files with 3 additions and 1 deletions

View file

@ -2328,7 +2328,6 @@ def km_node_editor(params):
op_menu_pie("NODE_MT_view_pie", {"type": 'ACCENT_GRAVE', "value": 'PRESS'}),
("node.delete", {"type": 'X', "value": 'PRESS'}, None),
("node.delete", {"type": 'DEL', "value": 'PRESS'}, None),
("node.delete_copy_reconnect", {"type": 'X', "value": 'PRESS', "ctrl": True}, None),
("node.delete_reconnect", {"type": 'DEL', "value": 'PRESS', "ctrl": True}, None),
*_template_items_select_actions(params, "node.select_all"),
("node.select_linked_to", {"type": 'L', "value": 'PRESS', "shift": True}, None),

View file

@ -431,6 +431,8 @@ class NODE_MT_node(Menu):
layout.operator("transform.resize")
layout.separator()
layout.operator("node.delete_copy_reconnect", text="Cut")
layout.operator_context = 'EXEC_DEFAULT'
layout.operator("node.clipboard_copy", text="Copy", icon='COPYDOWN')
layout.operator_context = 'EXEC_DEFAULT'
layout.operator("node.clipboard_paste", text="Paste", icon='PASTEDOWN')
@ -723,6 +725,7 @@ class NODE_MT_context_menu(Menu):
layout.separator()
layout.operator("node.delete_copy_reconnect", text="Cut")
layout.operator("node.clipboard_copy", text="Copy", icon='COPYDOWN')
layout.operator("node.clipboard_paste", text="Paste", icon='PASTEDOWN')