From 7c0c31efb0adc484e254b39c7bd2c6db00d64433 Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Mon, 24 Mar 2025 10:20:39 +0200 Subject: [PATCH] Nodes: Enable panel toggles in the Compositor This patch enables panel toggles in the compositor since it now supports boolean sockets. This essentially reverts c3957f432a. --- scripts/startup/bl_operators/node.py | 2 +- scripts/startup/bl_ui/space_node.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index 483858a1df6..512ac312c67 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -314,7 +314,7 @@ class NODE_OT_interface_item_new(NodeInterfaceOperator, Operator): active_item = interface.active # Panels have the extra option to add a toggle. - if active_item and active_item.item_type == 'PANEL' and tree.type in {'GEOMETRY', 'SHADER'}: + if active_item and active_item.item_type == 'PANEL': items.append(('PANEL_TOGGLE', "Panel Toggle", "")) return items diff --git a/scripts/startup/bl_ui/space_node.py b/scripts/startup/bl_ui/space_node.py index b1ad50f3308..6044a508ebf 100644 --- a/scripts/startup/bl_ui/space_node.py +++ b/scripts/startup/bl_ui/space_node.py @@ -911,12 +911,11 @@ class NODE_MT_node_tree_interface_context_menu(Menu): active_item = tree.interface.active layout.operator("node.interface_item_duplicate", icon='DUPLICATE') - if tree.type in {'GEOMETRY', 'SHADER'}: - layout.separator() - if active_item.item_type == 'SOCKET': - layout.operator("node.interface_item_make_panel_toggle") - elif active_item.item_type == 'PANEL': - layout.operator("node.interface_item_unlink_panel_toggle") + layout.separator() + if active_item.item_type == 'SOCKET': + layout.operator("node.interface_item_make_panel_toggle") + elif active_item.item_type == 'PANEL': + layout.operator("node.interface_item_unlink_panel_toggle") class NODE_PT_node_tree_interface(Panel):