diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-10-24 09:43:20 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-10-24 09:43:20 +0300 |
commit | 65d4314b8e43c0d1e30ec105a929a1adf4268d01 (patch) | |
tree | 9f549974a742d1e002dc90af3132574f2ae67b07 | |
parent | 35d7211bfae981c8299345928ab2905c17782ab9 (diff) |
Fix (unreported) bad halding of ID usercounts when fully copying a scene.
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 1eb65519596..3a067221aad 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -402,6 +402,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) for (SceneRenderLayer *srl_dst = sce_copy->r.layers.first; srl_dst; srl_dst = srl_dst->next) { for (FreestyleLineSet *lineset = srl_dst->freestyleConfig.linesets.first; lineset; lineset = lineset->next) { if (lineset->linestyle) { + id_us_min(&lineset->linestyle->id); /* XXX Not copying anim/actions here? */ BKE_id_copy_ex(bmain, (ID *)lineset->linestyle, (ID **)&lineset->linestyle, 0, false); } @@ -410,12 +411,14 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) /* Full copy of world (included animations) */ if (sce_copy->world) { + id_us_min(&sce_copy->world->id); BKE_id_copy_ex(bmain, (ID *)sce_copy->world, (ID **)&sce_copy->world, LIB_ID_COPY_ACTIONS, false); } /* Full copy of GreasePencil. */ /* XXX Not copying anim/actions here? */ if (sce_copy->gpd) { + id_us_min(&sce_copy->gpd->id); BKE_id_copy_ex(bmain, (ID *)sce_copy->gpd, (ID **)&sce_copy->gpd, 0, false); } } @@ -430,6 +433,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) * are done outside of blenkernel with ED_objects_single_users! */ /* camera */ + /* XXX This is most certainly useless? Object have not yet been duplicated... */ if (ELEM(type, SCE_COPY_LINK_DATA, SCE_COPY_FULL)) { ID_NEW_REMAP(sce_copy->camera); } |