Commit: c544df997ed9869ee053f1b45e1da6d8bf5f5e9c Author: Maxim Vasiliev Date: Mon Apr 6 16:23:43 2020 +0200 Branches: master https://developer.blender.org/rBc544df997ed9869ee053f1b45e1da6d8bf5f5e9c
Fix user counting when ungrouping a node group. Existing code for ungrouping did not correctly handle user counters: - counter for the group was not decremented - counters for containing nodes were not incremented The latter resulted in losing some nodes after orphan cleaning or several save/reload cycles. The bug did not have destructive consequences until recently, because it was compensated by another bug (fixed in rBe993667a46c2). Maniphest Tasks: T74665, T74682 Differential Revision: https://developer.blender.org/D7332 =================================================================== M source/blender/editors/space_node/node_group.c =================================================================== diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index 2a4c6147d5d..3a0ef45a68d 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -193,11 +193,11 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode) } /* wgroup is a temporary copy of the NodeTree we're merging in - * - all of wgroup's nodes are transferred across to their new home + * - all of wgroup's nodes are copied across to their new home * - ngroup (i.e. the source NodeTree) is left unscathed - * - temp copy. don't change ID usercount + * - temp copy. do change ID usercount for the copies */ - wgroup = ntreeCopyTree_ex_new_pointers(ngroup, bmain, false); + wgroup = ntreeCopyTree_ex_new_pointers(ngroup, bmain, true); /* Add the nodes into the ntree */ for (node = wgroup->nodes.first; node; node = nextnode) { @@ -351,8 +351,8 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode) nodeRemoveNode(bmain, ntree, node, false); } - /* delete the group instance */ - nodeRemoveNode(bmain, ntree, gnode, false); + /* delete the group instance and dereference group tree */ + nodeRemoveNode(bmain, ntree, gnode, true); ntree->update |= NTREE_UPDATE_NODES | NTREE_UPDATE_LINKS; _______________________________________________ Bf-blender-cvs mailing list [email protected] https://lists.blender.org/mailman/listinfo/bf-blender-cvs
