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.
This commit is contained in:
Omar Emara
2025-03-24 10:20:39 +02:00
parent 55e09a6cbf
commit 7c0c31efb0
2 changed files with 6 additions and 7 deletions

View File

@@ -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

View File

@@ -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):