diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-07-11 07:21:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-07-11 07:21:05 +0300 |
commit | 64dd9a117dfabad1a9372d34e8804e7ec1ad9828 (patch) | |
tree | d08580f3bb835a3499471da8478c4a61f1e2b0aa /source/blender/blenkernel/intern/scene.c | |
parent | bb0bdc6ce262b6293bd351c97ea05990c9315dd7 (diff) | |
parent | a247b367b0f7c0486ed8eef4c2a5a753e963ea6c (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 85c28b8bf54..3b2287a7921 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -247,7 +247,9 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) scen = BKE_libblock_copy(bmain, &sce->id); BLI_duplicatelist(&(scen->base), &(sce->base)); - id_us_plus((ID *)scen->world); + if (type != SCE_COPY_FULL) { + id_us_plus((ID *)scen->world); + } id_us_plus((ID *)scen->set); /* id_us_plus((ID *)scen->gm.dome.warptext); */ /* XXX Not refcounted? see readfile.c */ @@ -297,7 +299,8 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) if (type == SCE_COPY_FULL) { for (lineset = new_srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) { if (lineset->linestyle) { - id_us_plus((ID *)lineset->linestyle); + /* Has been incremented by BKE_freestyle_config_copy(). */ + id_us_min(&lineset->linestyle->id); lineset->linestyle = BKE_linestyle_copy(bmain, lineset->linestyle); } } @@ -384,11 +387,19 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) ts->sculpt = MEM_dupallocN(ts->sculpt); BKE_paint_copy(&ts->sculpt->paint, &ts->sculpt->paint); } + if (ts->uvsculpt) { + ts->uvsculpt = MEM_dupallocN(ts->uvsculpt); + BKE_paint_copy(&ts->uvsculpt->paint, &ts->uvsculpt->paint); + } BKE_paint_copy(&ts->imapaint.paint, &ts->imapaint.paint); ts->imapaint.paintcursor = NULL; id_us_plus((ID *)ts->imapaint.stencil); + id_us_plus((ID *)ts->imapaint.clone); + id_us_plus((ID *)ts->imapaint.canvas); ts->particle.paintcursor = NULL; + ts->particle.scene = NULL; + ts->particle.object = NULL; /* duplicate Grease Pencil Drawing Brushes */ BLI_listbase_clear(&ts->gp_brushes); @@ -432,7 +443,6 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) /* world */ if (type == SCE_COPY_FULL) { if (scen->world) { - id_us_plus((ID *)scen->world); scen->world = BKE_world_copy(bmain, scen->world); BKE_animdata_copy_id_action((ID *)scen->world, false); } |