diff options
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 16 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 8 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 4 |
4 files changed, 26 insertions, 8 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); } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 8890aa5d1ac..659dfbfd57d 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1330,7 +1330,11 @@ static int image_open_exec(bContext *C, wmOperator *op) iuser->frames = frame_seq_len; iuser->sfra = 1; iuser->framenr = 1; - iuser->offset = frame_ofs - 1; + if (ima->source == IMA_SRC_MOVIE) { + iuser->offset = 0; + } else { + iuser->offset = frame_ofs - 1; + } iuser->fie_ima = 2; iuser->scene = scene; BKE_image_init_imageuser(ima, iuser); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 799fb6d5018..471b8ae29d9 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -9600,9 +9600,13 @@ static void bbs_mesh_solid_verts(Scene *scene, Object *ob) DM_update_materials(dm, ob); - dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, GPU_object_material_bind, NULL, me, DM_DRAW_SKIP_HIDDEN); + /* Only draw faces to mask out verts, we don't want their selection ID's. */ + const int G_f_orig = G.f; + G.f &= ~G_BACKBUFSEL; - GPU_object_material_unbind(); + dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, NULL, NULL, me, DM_DRAW_SKIP_HIDDEN); + + G.f |= (G_f_orig & G_BACKBUFSEL); bbs_obmode_mesh_verts(ob, dm, 1); bm_vertoffs = me->totvert + 1; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ecbb9fbee0b..f7b0bbd8324 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -725,6 +725,8 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, re->r.size = source->r.size; } + re_init_resolution(re, source, winx, winy, disprect); + /* disable border if it's a full render anyway */ if (re->r.border.xmin == 0.0f && re->r.border.xmax == 1.0f && re->r.border.ymin == 0.0f && re->r.border.ymax == 1.0f) @@ -732,8 +734,6 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, re->r.mode &= ~R_BORDER; } - re_init_resolution(re, source, winx, winy, disprect); - if (re->rectx < 1 || re->recty < 1 || (BKE_imtype_is_movie(rd->im_format.imtype) && (re->rectx < 16 || re->recty < 16) )) { |