remove vertex selection check for weight paint mode so you can paint `through` the...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 1 Jan 2013 11:47:47 +0000 (11:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 1 Jan 2013 11:47:47 +0000 (11:47 +0000)
also made the wire draw without depth masking when the depth check is off, similar to mesh editmode drawing, nice hint about whats going on.

release/scripts/startup/bl_ui/space_view3d.py
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_view3d/drawmesh.c

index d2183b80476ef6759662c23fa83aa90777facb9c..8189ee21bc8b2fbc498f5b0231787a040557293a 100644 (file)
@@ -71,7 +71,7 @@ class VIEW3D_HT_header(Header):
 
             # Occlude geometry
             if ((view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH'))) or
-                    (mode == 'WEIGHT_PAINT' and obj.data.use_paint_mask_vertex)):
+                    (mode == 'WEIGHT_PAINT')):
                 row.prop(view, "use_occlude_geometry", text="")
 
             # Proportional editing
index 819305f950810af4b6f5e18991a006349fb595a1..15d5257af60c2bf3144260a699cbf88609a4c838 100644 (file)
@@ -2194,7 +2194,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        float alpha;
        float mval[2];
        int use_vert_sel;
-       int use_zbuf;
+       int use_depth;
 
        MDeformWeight *(*dw_func)(MDeformVert *, const int) =
                (brush->vertexpaint_tool == PAINT_BLEND_BLUR) ?
@@ -2258,10 +2258,10 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        swap_m4m4(wpd->vc.rv3d->persmat, mat);
 
        use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
-       use_zbuf = use_vert_sel && (vc->v3d->flag & V3D_ZBUF_SELECT);
+       use_depth = (vc->v3d->flag & V3D_ZBUF_SELECT);
 
        /* which faces are involved */
-       if (use_zbuf) {
+       if (use_depth) {
                if (wp->flag & VP_AREA) {
                        /* Ugly hack, to avoid drawing vertex index when getting the face index buffer - campbell */
                        me->editflag &= ~ME_EDIT_PAINT_VERT_SEL;
@@ -2310,7 +2310,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        } (void)0
 
 
-       if (use_zbuf) {
+       if (use_depth) {
                for (index = 0; index < totindex; index++) {
                        if (indexar[index] && indexar[index] <= me->totpoly) {
                                MPoly *mpoly = me->mpoly + (indexar[index] - 1);
@@ -2372,7 +2372,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
                } \
        } (void)0
 
-       if (use_zbuf) {
+       if (use_depth) {
                for (index = 0; index < totindex; index++) {
 
                        if (indexar[index] && indexar[index] <= me->totpoly) {
index ad7d3b1bdddd31141b029059f4f0d876dd992a89..0e86438997c3e7d91036914d32e546ad3465b8aa 100644 (file)
@@ -1066,12 +1066,18 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
                draw_mesh_face_select(rv3d, me, dm);
        }
        else if ((do_light == FALSE) || (ob->dtx & OB_DRAWWIRE)) {
+               const int use_depth = (v3d->flag & V3D_ZBUF_SELECT);
 
                /* weight paint in solid mode, special case. focus on making the weights clear
                 * rather than the shading, this is also forced in wire view */
 
-               bglPolygonOffset(rv3d->dist, 1.0);
-               glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
+               if (use_depth) {
+                       bglPolygonOffset(rv3d->dist, 1.0);
+                       glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
+               }
+               else {
+                       glDisable(GL_DEPTH_TEST);
+               }
 
                glEnable(GL_BLEND);
                glColor4ub(255, 255, 255, 96);
@@ -1080,8 +1086,14 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
 
                dm->drawEdges(dm, 1, 1);
 
-               bglPolygonOffset(rv3d->dist, 0.0);
-               glDepthMask(1);
+               if (use_depth) {
+                       bglPolygonOffset(rv3d->dist, 0.0);
+                       glDepthMask(1);
+               }
+               else {
+                       glEnable(GL_DEPTH_TEST);
+               }
+
                glDisable(GL_LINE_STIPPLE);
                glDisable(GL_BLEND);
        }