[Bf-blender-cvs] [9cccbbebaa3] blender-v2.92-release: Fix T84624: node group data-block has phantom user

Jacques Lucke noreply at git.blender.org
Mon Feb 15 19:29:43 CET 2021


Commit: 9cccbbebaa3f03aa5137bd54f991f2cd824a3977
Author: Jacques Lucke
Date:   Mon Feb 15 19:29:09 2021 +0100
Branches: blender-v2.92-release
https://developer.blender.org/rB9cccbbebaa3f03aa5137bd54f991f2cd824a3977

Fix T84624: node group data-block has phantom user

This is because the node editor added a "real user" to the node group
that it displays. It was mainly added as a hack to solve issues with custom
tree types (T36024). Since we can store id references in custom properties
now, this "real user" is not really necessary anymore.

Given that we are close to a release, I'll only disable line for geometry nodes,
for which the bug has been reported.

Discussed this solution with Hans Goudey.

===================================================================

M	source/blender/editors/space_node/space_node.c

===================================================================

diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index ad7632377a3..5960360dc33 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -80,7 +80,12 @@ void ED_node_tree_start(SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from)
 
     BLI_addtail(&snode->treepath, path);
 
-    id_us_ensure_real(&ntree->id);
+    if (ntree->type != NTREE_GEOMETRY) {
+      /* This can probably be removed for all node tree types. It mainly exists because it was not
+       * possible to store id references in custom properties. Also see T36024. I don't want to
+       * remove it for all tree types in bcon3 though. */
+      id_us_ensure_real(&ntree->id);
+    }
   }
 
   /* update current tree */



More information about the Bf-blender-cvs mailing list