From c2b9ced6b3392269cd194cce57196b89be64602f Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Wed, 15 Nov 2023 14:18:12 +0100 Subject: [PATCH] Fix #104991: Node Wrangler Merge Nodes shadows other keymaps (Ctrl+,) Node Wrangler's Merge Nodes operator uses many shortcuts to merge inputs in different ways. One of those shortcuts is Ctrl + , (comma) which was not used by default until Blender 4.0. In this version it was affected the Open Preferences Operator, resulting in a conflict. In many cases, the operator will have no action, such as when no node tree is active, or when no node is selected. In those cases, the operator can simply return {'PASS_THROUGH'} and let the shortcut be handled by another operator. A cleaner solution to this issue would be to refactor the operator so that the list of nodes to act on is gathered in the poll() method, and not call the operator at all if there is nothing to do, but this refactor would require deeper changes. --- node_wrangler/operators.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/node_wrangler/operators.py b/node_wrangler/operators.py index ca05fb695..7a651ad41 100644 --- a/node_wrangler/operators.py +++ b/node_wrangler/operators.py @@ -1103,6 +1103,17 @@ class NWMergeNodes(Operator, NWBase): if selected_mix and selected_math and merge_type == 'AUTO': selected_mix += selected_math selected_math = [] + + # If no nodes are selected, do nothing and pass through. + if not any(nodes_list for nodes_list in [selected_mix, + selected_shader, + selected_geometry, + selected_math, + selected_vector, + selected_z, + selected_alphaover]): + return {'PASS_THROUGH'} + for nodes_list in [ selected_mix, selected_shader, -- 2.30.2