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 Tönne <lukas.toenne@gmail.com>2014-03-21 17:07:49 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-03-21 17:07:49 +0400
commit6e99fb04b6cccef4d5685184dfd0d1406fc6e624 (patch)
treed3accf9af5b16ca867e945317a8eefcd727bfcf8 /source/blender/blenkernel/intern/node.c
parentc626462c0fe1257c07948b49db1a41526682ba3f (diff)
Use the new BKE_libblock_copy_nolib function for bNodeTree datablocks
as well. These were already doing the same thing, just not as nice. Only difference is the do_action argument (false for BKE_libblock_copy_nolib) but this is of no consequence because the function is only called for trees nested inside material, scene, etc., which never have own actions.
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r--source/blender/blenkernel/intern/node.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 249fb5264fe..d8d83cb536b 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1114,20 +1114,13 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, Main *bmain, bool do_
if (ntree == NULL) return NULL;
- if (bmain) {
- /* is ntree part of library? */
- if (BLI_findindex(&bmain->nodetree, ntree) != -1)
- newtree = BKE_libblock_copy(&ntree->id);
- else
- newtree = NULL;
+ /* is ntree part of library? */
+ if (bmain && BLI_findindex(&bmain->nodetree, ntree) >= 0) {
+ newtree = BKE_libblock_copy(&ntree->id);
}
- else
- newtree = NULL;
-
- if (newtree == NULL) {
- newtree = MEM_dupallocN(ntree);
+ else {
+ newtree = BKE_libblock_copy_nolib(&ntree->id);
newtree->id.lib = NULL; /* same as owning datablock id.lib */
- BKE_libblock_copy_data(&newtree->id, &ntree->id, true); /* copy animdata and ID props */
}
id_us_plus((ID *)newtree->gpd);