[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53479] trunk/blender: remove vertex selection check for weight paint mode so you can paint `through` the mesh .

Campbell Barton ideasman42 at gmail.com
Tue Jan 1 12:47:48 CET 2013


Revision: 53479
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53479
Author:   campbellbarton
Date:     2013-01-01 11:47:47 +0000 (Tue, 01 Jan 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
    trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
    trunk/blender/source/blender/editors/space_view3d/drawmesh.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2013-01-01 11:46:12 UTC (rev 53478)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2013-01-01 11:47:47 UTC (rev 53479)
@@ -71,7 +71,7 @@
 
             # 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

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c	2013-01-01 11:46:12 UTC (rev 53478)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c	2013-01-01 11:47:47 UTC (rev 53479)
@@ -2194,7 +2194,7 @@
 	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 @@
 	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 @@
 	} (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 @@
 		} \
 	} (void)0
 
-	if (use_zbuf) {
+	if (use_depth) {
 		for (index = 0; index < totindex; index++) {
 
 			if (indexar[index] && indexar[index] <= me->totpoly) {

Modified: trunk/blender/source/blender/editors/space_view3d/drawmesh.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2013-01-01 11:46:12 UTC (rev 53478)
+++ trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2013-01-01 11:47:47 UTC (rev 53479)
@@ -1066,12 +1066,18 @@
 		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 @@
 
 		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);
 	}




More information about the Bf-blender-cvs mailing list