Fix T99830: missing update after reordering node group sockets
This commit is contained in:
parent
5da807e00f
commit
beb746135d
Notes:
blender-bot
2023-02-14 08:08:56 +01:00
Referenced by issue #99830, Regression: Attribute input becomes single value when its socket is reordered past a string socket
|
@ -37,6 +37,7 @@ using blender::MultiValueMap;
|
|||
using blender::Set;
|
||||
using blender::Stack;
|
||||
using blender::StringRef;
|
||||
using blender::Vector;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Node Group
|
||||
|
@ -160,6 +161,7 @@ static void group_verify_socket_list(bNodeTree &node_tree,
|
|||
const bool ensure_extend_socket_exists)
|
||||
{
|
||||
ListBase old_sockets = verify_lb;
|
||||
Vector<bNodeSocket *> ordered_old_sockets = old_sockets;
|
||||
BLI_listbase_clear(&verify_lb);
|
||||
|
||||
LISTBASE_FOREACH (const bNodeSocket *, interface_socket, &interface_sockets) {
|
||||
|
@ -193,6 +195,19 @@ static void group_verify_socket_list(bNodeTree &node_tree,
|
|||
LISTBASE_FOREACH_MUTABLE (bNodeSocket *, unused_socket, &old_sockets) {
|
||||
nodeRemoveSocket(&node_tree, &node, unused_socket);
|
||||
}
|
||||
|
||||
{
|
||||
/* Check if new sockets match the old sockets. */
|
||||
int index;
|
||||
LISTBASE_FOREACH_INDEX (bNodeSocket *, new_socket, &verify_lb, index) {
|
||||
if (index < ordered_old_sockets.size()) {
|
||||
if (ordered_old_sockets[index] != new_socket) {
|
||||
BKE_ntree_update_tag_interface(&node_tree);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void node_group_update(struct bNodeTree *ntree, struct bNode *node)
|
||||
|
|
Loading…
Reference in New Issue