remove vertex selection check for weight paint mode so you can paint through the mesh.

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.
This commit is contained in:
Campbell Barton 2013-01-01 11:47:47 +00:00
parent b79ec3ac2e
commit e4f65749f9
3 changed files with 22 additions and 10 deletions

@ -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

@ -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) {

@ -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);
}