Fix: Nodes: only expose panel toggles in geometry and shader nodes

The compositor does not support boolean sockets currently.
This commit is contained in:
Jacques Lucke
2025-02-28 19:23:44 +01:00
parent 2822777f13
commit c3957f432a
2 changed files with 7 additions and 6 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':
if active_item and active_item.item_type == 'PANEL' and tree.type in ('GEOMETRY', 'SHADER'):
items.append(('PANEL_TOGGLE', "Panel Toggle", ""))
return items

View File

@@ -911,11 +911,12 @@ class NODE_MT_node_tree_interface_context_menu(Menu):
active_item = tree.interface.active
layout.operator("node.interface_item_duplicate", icon='DUPLICATE')
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")
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")
class NODE_PT_node_tree_interface(Panel):