Fix: Nodes: propagated menu expanded state to group input

Previously, when a new group input was created from an expanded menu
socket, the expanded flag was not set on the group input.
This commit is contained in:
Jacques Lucke
2025-09-29 18:28:11 +02:00
parent baa0bd6fbb
commit 01ccf31d20

View File

@@ -24,6 +24,7 @@
#include "DNA_node_types.h"
#include "NOD_node_declaration.hh"
#include "NOD_socket_declarations.hh"
using blender::StringRef;
@@ -1157,6 +1158,11 @@ bNodeTreeInterfaceSocket *add_interface_socket_from_node(bNodeTree &ntree,
description = decl->description;
}
SET_FLAG_FROM_TEST(flag, decl->optional_label, NODE_INTERFACE_SOCKET_OPTIONAL_LABEL);
if (socket_type == "NodeSocketMenu" && from_sock.type == SOCK_MENU) {
if (const auto *menu_decl = dynamic_cast<const nodes::decl::Menu *>(decl)) {
SET_FLAG_FROM_TEST(flag, menu_decl->is_expanded, NODE_INTERFACE_SOCKET_MENU_EXPANDED);
}
}
}
iosock = ntree.tree_interface.add_socket(name, description, socket_type, flag, nullptr);