From d3639828f89bb0d84de71bb28ec8cff6a40aceeb Mon Sep 17 00:00:00 2001 From: quackarooni Date: Tue, 15 Apr 2025 15:26:44 +0200 Subject: [PATCH] Fix: Nodes: "Make Panel Toggle" can turn Boolean output sockets into panel toggles The "Make Panel Toggle" operator does not check if active item is an input socket, leading to a situation where it can be called on Boolean output sockets. Doing this creates weird behavior where the panel and associated operators believe it has a toggle, but is not reflected in the UI drawing. Other weird behaviors include being able to rearrange output sockets and apply the operator again to another output socket. This patch adds a check in the operator's poll function to prevent it from being called on output sockets. Pull Request: https://projects.blender.org/blender/blender/pulls/137526 --- scripts/startup/bl_operators/node.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index 5bb5bba8940..be470dd192c 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -463,9 +463,11 @@ class NODE_OT_interface_item_make_panel_toggle(NodeInterfaceOperator, Operator): active_item = interface.active if not active_item: return False - if type(active_item) is not bpy.types.NodeTreeInterfaceSocketBool: - cls.poll_message_set("Only boolean sockets are supported") + + if type(active_item) is not bpy.types.NodeTreeInterfaceSocketBool or active_item.in_out != 'INPUT': + cls.poll_message_set("Only boolean input sockets are supported") return False + parent_panel = active_item.parent if parent_panel.parent is None: cls.poll_message_set("Socket must be in a panel")