diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-08-14 18:07:30 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-08-14 18:07:30 +0300 |
commit | 3ab46f42046854e1f4c036a9b779177136017772 (patch) | |
tree | 9d0b1414feb32b955a4282d9f7117893d2811e99 /source/blender/blenkernel/intern/node.c | |
parent | 230be97284de444e6b2566f535141ca31647f6ab (diff) | |
parent | 3cd51c0379638045cd32c9aa74215032d7bc381b (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index d33b1ce7d06..346d107792e 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1221,17 +1221,12 @@ bNodeTree *ntreeAddTree(Main *bmain, const char *name, const char *idname) */ void BKE_node_tree_copy_data(Main *UNUSED(bmain), bNodeTree *ntree_dst, const bNodeTree *ntree_src, const int flag) { - bNode *node_src; bNodeSocket *sock_dst, *sock_src; bNodeLink *link_dst; /* We never handle usercount here for own data. */ const int flag_subdata = flag | LIB_ID_CREATE_NO_USER_REFCOUNT; - if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) { - id_us_plus((ID *)ntree_dst->gpd); - } - /* in case a running nodetree is copied */ ntree_dst->execdata = NULL; @@ -1240,7 +1235,7 @@ void BKE_node_tree_copy_data(Main *UNUSED(bmain), bNodeTree *ntree_dst, const bN BLI_listbase_clear(&ntree_dst->nodes); BLI_listbase_clear(&ntree_dst->links); - for (node_src = ntree_src->nodes.first; node_src; node_src = node_src->next) { + for (bNode *node_src = ntree_src->nodes.first; node_src; node_src = node_src->next) { BKE_node_copy_ex(ntree_dst, node_src, flag_subdata); } @@ -1291,9 +1286,9 @@ void BKE_node_tree_copy_data(Main *UNUSED(bmain), bNodeTree *ntree_dst, const bN } /* update node->parent pointers */ - for (node_src = ntree_dst->nodes.first; node_src; node_src = node_src->next) { - if (node_src->parent) { - node_src->parent = node_src->parent->new_node; + for (bNode *node_dst = ntree_dst->nodes.first, *node_src = ntree_src->nodes.first; node_dst; node_dst = node_dst->next, node_src = node_src->next) { + if (node_dst->parent) { + node_dst->parent = node_dst->parent->new_node; } } |