Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-03-16 13:23:45 +0300
committerFabian Schempp <fabianschempp@googlemail.com>2022-04-11 01:30:49 +0300
commit793546a68d90e0d6273ba467cd2d32773de89566 (patch)
treefbcc84b72172a621a8113c7ac8b0417ce7ac710f /source/blender/editors/space_node/node_templates.cc
parent7531f764968a670f8cab7fbb09e584968722c07c (diff)
Fix T96386: crash when changing shader to node group in properties
The previous code updated the wrong node tree. The result was that the new group node did not have the socket that was supposed to be linked.
Diffstat (limited to 'source/blender/editors/space_node/node_templates.cc')
-rw-r--r--source/blender/editors/space_node/node_templates.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/node_templates.cc b/source/blender/editors/space_node/node_templates.cc
index 8cd87574465..b63cb2eeee5 100644
--- a/source/blender/editors/space_node/node_templates.cc
+++ b/source/blender/editors/space_node/node_templates.cc
@@ -69,11 +69,11 @@ static bool node_link_item_compare(bNode *node, NodeLinkItem *item)
return true;
}
-static void node_link_item_apply(Main *bmain, bNode *node, NodeLinkItem *item)
+static void node_link_item_apply(bNodeTree *ntree, bNode *node, NodeLinkItem *item)
{
if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP)) {
node->id = (ID *)item->ngroup;
- BKE_ntree_update_main_tree(bmain, item->ngroup, nullptr);
+ BKE_ntree_update_tag_node_property(ntree, node);
}
else {
/* nothing to do for now */
@@ -237,7 +237,8 @@ static void node_socket_add_replace(const bContext *C,
nodePositionRelative(node_from, node_to, sock_from_tmp, sock_to);
}
- node_link_item_apply(bmain, node_from, item);
+ node_link_item_apply(ntree, node_from, item);
+ ED_node_tree_propagate_change(C, bmain, ntree);
}
nodeSetActive(ntree, node_from);