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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-05-08 20:00:08 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-05-08 20:00:08 +0400
commit8deba334977d13c83dee1fb9a54c4fe15c252918 (patch)
tree72e50aa1e6e300ea4404a71e20bbded3f87d95f4 /source/blender/makesrna/intern/rna_nodetree.c
parenta092611f67865bb097b49cbbb37fb59489f52c16 (diff)
Fix for node group user count: since node group pointer uses an explicit setter callback it has to do user count increment/decrement manually.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 7bee0565c93..d2d3a4b0488 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -193,6 +193,7 @@ EnumPropertyItem prop_wave_items[] = {
#include "BKE_context.h"
#include "BKE_idprop.h"
+#include "BKE_library.h"
#include "BKE_global.h"
@@ -2370,8 +2371,14 @@ static void rna_NodeGroup_node_tree_set(PointerRNA *ptr, const PointerRNA value)
bNode *node = ptr->data;
bNodeTree *ngroup = value.data;
- if (nodeGroupPoll(ntree, ngroup))
+ if (nodeGroupPoll(ntree, ngroup)) {
+ if (node->id)
+ id_us_min(node->id);
+ if (ngroup)
+ id_us_plus(&ngroup->id);
+
node->id = &ngroup->id;
+ }
}
static int rna_NodeGroup_node_tree_poll(PointerRNA *ptr, const PointerRNA value)