From 85b93772dbc52d4f8edf2e6ed73be63e0094f704 Mon Sep 17 00:00:00 2001 From: Iliya Katueshenock Date: Wed, 14 Feb 2024 16:49:07 +0100 Subject: [PATCH] Fix #118104: Menu Switch shows menu socket in input link-drag-search The node currently doesn't support outputting the menu socket type. Pull Request: https://projects.blender.org/blender/blender/pulls/118110 --- .../nodes/geometry/nodes/node_geo_menu_switch.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/blender/nodes/geometry/nodes/node_geo_menu_switch.cc b/source/blender/nodes/geometry/nodes/node_geo_menu_switch.cc index 43236254c36..8f26387077c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_menu_switch.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_menu_switch.cc @@ -149,8 +149,8 @@ static void node_copy_storage(bNodeTree * /*dst_tree*/, bNode *dst_node, const b static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { + const eNodeSocketDatatype data_type = eNodeSocketDatatype(params.other_socket().type); if (params.in_out() == SOCK_IN) { - const eNodeSocketDatatype data_type = eNodeSocketDatatype(params.other_socket().type); if (data_type == SOCK_MENU) { params.add_item(IFACE_("Menu"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("GeometryNodeMenuSwitch"); @@ -159,11 +159,13 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) } } else { - params.add_item(IFACE_("Output"), [](LinkSearchOpParams ¶ms) { - bNode &node = params.add_node("GeometryNodeMenuSwitch"); - node_storage(node).data_type = params.socket.type; - params.update_and_connect_available_socket(node, "Output"); - }); + if (data_type != SOCK_MENU) { + params.add_item(IFACE_("Output"), [](LinkSearchOpParams ¶ms) { + bNode &node = params.add_node("GeometryNodeMenuSwitch"); + node_storage(node).data_type = params.socket.type; + params.update_and_connect_available_socket(node, "Output"); + }); + } } }