diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-03-08 09:26:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-03-08 09:27:36 +0300 |
commit | 28f86bf117e9d9d10089ef758a5ec4ade65084c6 (patch) | |
tree | c7a38531fd6063080d7ae618555ce6f51df23770 /source | |
parent | cb8311fecfaaf2b755fcf8e8d52af83f512688b0 (diff) |
Cleanup: use edit/active objects from view context
Needed to implement multiple edit-objects.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 7e613e36119..cc046eebc68 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1318,31 +1318,30 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) /* *********************** backdraw for selection *************** */ -static void backdrawview3d(Scene *scene, wmWindow *win, ARegion *ar, View3D *v3d) +static void backdrawview3d(Scene *scene, wmWindow *win, ARegion *ar, View3D *v3d, Object *obact, Object *obedit) { RegionView3D *rv3d = ar->regiondata; - struct Base *base = scene->basact; int multisample_enabled; BLI_assert(ar->regiontype == RGN_TYPE_WINDOW); - if (base && (base->object->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT) || - BKE_paint_select_face_test(base->object))) + if (obact && (obact->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT) || + BKE_paint_select_face_test(obact))) { /* do nothing */ } /* texture paint mode sampling */ - else if (base && (base->object->mode & OB_MODE_TEXTURE_PAINT) && + else if (obact && (obact->mode & OB_MODE_TEXTURE_PAINT) && (v3d->drawtype > OB_WIRE)) { /* do nothing */ } - else if ((base && (base->object->mode & OB_MODE_PARTICLE_EDIT)) && + else if ((obact && (obact->mode & OB_MODE_PARTICLE_EDIT)) && V3D_IS_ZBUF(v3d)) { /* do nothing */ } - else if (scene->obedit && + else if (obedit && V3D_IS_ZBUF(v3d)) { /* do nothing */ @@ -1417,10 +1416,11 @@ static void backdrawview3d(Scene *scene, wmWindow *win, ARegion *ar, View3D *v3d ED_view3d_clipping_set(rv3d); G.f |= G_BACKBUFSEL; - - if (base && (base->lay & v3d->lay)) - draw_object_backbufsel(scene, v3d, rv3d, base->object); - + + if (obact && (obact->lay & v3d->lay)) { + draw_object_backbufsel(scene, v3d, rv3d, obact); + } + if (rv3d->gpuoffscreen) GPU_offscreen_unbind(rv3d->gpuoffscreen, true); else @@ -1463,8 +1463,9 @@ static void view3d_opengl_read_Z_pixels(ARegion *ar, int x, int y, int w, int h, void ED_view3d_backbuf_validate(ViewContext *vc) { - if (vc->v3d->flag & V3D_INVALID_BACKBUF) - backdrawview3d(vc->scene, vc->win, vc->ar, vc->v3d); + if (vc->v3d->flag & V3D_INVALID_BACKBUF) { + backdrawview3d(vc->scene, vc->win, vc->ar, vc->v3d, vc->obact, vc->obedit); + } } /** |