[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43279] trunk/blender/source/blender/ editors/space_view3d/drawmesh.c: fix [#29794] Cannot hide faces in weight-paint mode

Campbell Barton ideasman42 at gmail.com
Wed Jan 11 08:03:57 CET 2012


Revision: 43279
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43279
Author:   campbellbarton
Date:     2012-01-11 07:03:47 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
fix [#29794] Cannot hide faces in weight-paint mode

bug was introduced with cycles merge.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawmesh.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawmesh.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2012-01-11 05:45:39 UTC (rev 43278)
+++ trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2012-01-11 07:03:47 UTC (rev 43279)
@@ -547,7 +547,7 @@
 	return draw_tface__set_draw_legacy(tface, data->has_mcol, matnr);
 }
 
-static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
+static int wpaint__setSolidDrawOptions_material(void *userData, int index, int *drawSmooth_r)
 {
 	Mesh *me = (Mesh*)userData;
 
@@ -562,6 +562,16 @@
 	return 1;
 }
 
+/* when face select is on, use face hidden flag */
+static int wpaint__setSolidDrawOptions_facemask(void *userData, int index, int *drawSmooth_r)
+{
+	Mesh *me = (Mesh*)userData;
+	MFace *mface = &me->mface[index];
+	if (mface->flag & ME_HIDE) return 0;
+	*drawSmooth_r = 1;
+	return 1;
+}
+
 static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
 {
 	Mesh *me = ob->data;
@@ -700,7 +710,7 @@
 	}
 	else if(draw_flags & DRAW_FACE_SELECT) {
 		if(ob->mode & OB_MODE_WEIGHT_PAINT)
-			dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, me, 1);
+			dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_facemask, GPU_enable_material, NULL, me, 1);
 		else
 			dm->drawMappedFacesTex(dm, me->mface ? draw_tface_mapped__set_draw : NULL, NULL, me);
 	}
@@ -857,7 +867,7 @@
 		/* weight paint mode exception */
 		int useColors= 1;
 
-		dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions,
+		dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_material,
 			GPU_enable_material, NULL, ob->data, useColors);
 	}
 	else {



More information about the Bf-blender-cvs mailing list