diff options
author | Jacques Lucke <jacques@blender.org> | 2022-09-18 22:06:56 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-09-18 22:07:23 +0300 |
commit | cf56b8be37c071f7d7fa22e3ab84029f4c895863 (patch) | |
tree | d3e3d384af941ff7706eb58685975e56a4f1cd94 /source/blender/blenkernel | |
parent | 53c92efd5a524ae6fd9172cdb23b5e787456f498 (diff) |
Fix T101166: crash when creating group input socket
The issue was that not all Group Input nodes were updated when
the node group interface changed.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/node_tree_update.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node_tree_update.cc b/source/blender/blenkernel/intern/node_tree_update.cc index b2caaa912d7..dcb6666317f 100644 --- a/source/blender/blenkernel/intern/node_tree_update.cc +++ b/source/blender/blenkernel/intern/node_tree_update.cc @@ -1047,6 +1047,7 @@ class NodeTreeMainUpdater { void update_individual_nodes(bNodeTree &ntree) { + Vector<bNode *> group_inout_nodes; LISTBASE_FOREACH (bNode *, node, &ntree.nodes) { nodeDeclarationEnsure(&ntree, node); if (this->should_update_individual_node(ntree, *node)) { @@ -1058,6 +1059,18 @@ class NodeTreeMainUpdater { ntype.updatefunc(&ntree, node); } } + if (ELEM(node->type, NODE_GROUP_INPUT, NODE_GROUP_OUTPUT)) { + group_inout_nodes.append(node); + } + } + /* The update function of group input/output nodes may add new interface sockets. When that + * happens, all the input/output nodes have to be updated again. In the future it would be + * better to move this functionality out of the node update function into the operator that's + * supposed to create the new interface socket. */ + if (ntree.runtime->changed_flag & NTREE_CHANGED_INTERFACE) { + for (bNode *node : group_inout_nodes) { + node->typeinfo->updatefunc(&ntree, node); + } } } |