diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-08-05 20:21:08 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2020-08-05 20:21:08 +0300 |
commit | 93f4f9681846926a4dcaf6e11d4d93dc69eb30ad (patch) | |
tree | b3a452fdd5ff8064e15c01c2f0388f2db4df1739 /source/blender | |
parent | 9118df1ecdfe08653c46925a9609d7651cc01594 (diff) | |
parent | a316d3b6c660a5ae9fbcae1f1403dad4686c8ecf (diff) |
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/nodes/shader/node_shader_tree.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index 179a92ec7bd..758f7edfe49 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -344,15 +344,23 @@ static void ntree_shader_unlink_hidden_value_sockets(bNode *group_node, bNodeSoc bool removed_link = false; for (node = group_ntree->nodes.first; node; node = node->next) { + const bool is_group = ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP) && (node->id != NULL); + LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { - if ((sock->flag & SOCK_HIDE_VALUE) == 0) { + if (!is_group && (sock->flag & SOCK_HIDE_VALUE) == 0) { continue; } /* If socket is linked to a group input node and sockets id match. */ if (sock && sock->link && sock->link->fromnode->type == NODE_GROUP_INPUT) { if (STREQ(isock->identifier, sock->link->fromsock->identifier)) { - nodeRemLink(group_ntree, sock->link); - removed_link = true; + if (is_group) { + /* Recursively unlink sockets within the nested group. */ + ntree_shader_unlink_hidden_value_sockets(node, sock); + } + else { + nodeRemLink(group_ntree, sock->link); + removed_link = true; + } } } } |