Changed ntreeCopyTree_ex() to accept a pointer to struct Main.

This commit is contained in:
2014-07-16 00:11:44 +09:00
parent d8f60d01e9
commit 4677684cfd
4 changed files with 7 additions and 7 deletions

View File

@@ -342,7 +342,7 @@ struct bNodeTree *ntreeAddTree(struct Main *bmain, const char *name, const char
/* copy/free funcs, need to manage ID users */
void ntreeFreeTree_ex(struct bNodeTree *ntree, const bool do_id_user);
void ntreeFreeTree(struct bNodeTree *ntree);
struct bNodeTree *ntreeCopyTree_ex(struct bNodeTree *ntree, const bool do_id_user);
struct bNodeTree *ntreeCopyTree_ex(struct bNodeTree *ntree, struct Main *bmain, const bool do_id_user);
struct bNodeTree *ntreeCopyTree(struct bNodeTree *ntree);
void ntreeSwitchID_ex(struct bNodeTree *ntree, struct ID *sce_from, struct ID *sce_to, const bool do_id_user);
void ntreeSwitchID(struct bNodeTree *ntree, struct ID *sce_from, struct ID *sce_to);

View File

@@ -1686,7 +1686,7 @@ void copy_matcopybuf(Material *ma)
matcopybuf.mtex[a] = MEM_dupallocN(mtex);
}
}
matcopybuf.nodetree = ntreeCopyTree_ex(ma->nodetree, false);
matcopybuf.nodetree = ntreeCopyTree_ex(ma->nodetree, G.main, false);
matcopybuf.preview = NULL;
BLI_listbase_clear(&matcopybuf.gpumaterial);
matcopied = 1;
@@ -1739,7 +1739,7 @@ void paste_matcopybuf(Material *ma)
}
}
ma->nodetree = ntreeCopyTree_ex(matcopybuf.nodetree, false);
ma->nodetree = ntreeCopyTree_ex(matcopybuf.nodetree, G.main, false);
}

View File

@@ -1205,13 +1205,13 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, Main *bmain, bool do_
return newtree;
}
bNodeTree *ntreeCopyTree_ex(bNodeTree *ntree, const bool do_id_user)
bNodeTree *ntreeCopyTree_ex(bNodeTree *ntree, Main *bmain, const bool do_id_user)
{
return ntreeCopyTree_internal(ntree, G.main, do_id_user, true, true);
return ntreeCopyTree_internal(ntree, bmain, do_id_user, true, true);
}
bNodeTree *ntreeCopyTree(bNodeTree *ntree)
{
return ntreeCopyTree_ex(ntree, true);
return ntreeCopyTree_ex(ntree, G.main, true);
}
/* use when duplicating scenes */

View File

@@ -200,7 +200,7 @@ static int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
* - ngroup (i.e. the source NodeTree) is left unscathed
* - temp copy. don't change ID usercount
*/
wgroup = ntreeCopyTree_ex(ngroup, false);
wgroup = ntreeCopyTree_ex(ngroup, G.main, false);
/* Add the nodes into the ntree */
for (node = wgroup->nodes.first; node; node = nextnode) {