Fix: Nodes: only expose panel toggles in geometry and shader nodes
The compositor does not support boolean sockets currently.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user