fix for bug where weight paint would draw hidden faces but not draw then with the...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 23 Dec 2012 08:20:44 +0000 (08:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 23 Dec 2012 08:20:44 +0000 (08:20 +0000)
source/blender/blenlib/intern/math_matrix.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c

index 3a294769eb339a37b8f6f1afbee067b8d79f32fc..02fc5b07d6da6affb0d1690e338f09e430b967c0 100644 (file)
@@ -990,7 +990,7 @@ void normalize_m4_m4(float rmat[4][4], float mat[4][4])
        if (len != 0.0f) rmat[2][3] = mat[2][3] / len;
 }
 
-void adjoint_m2_m2(float m1[][2], float m[][2])
+void adjoint_m2_m2(float m1[2][2], float m[2][2])
 {
        BLI_assert(m1 != m);
        m1[0][0] =  m[1][1];
index e36654323fd24d4189f1b4eeb5f19e2ab2d7d540..ad7d3b1bdddd31141b029059f4f0d876dd992a89 100644 (file)
@@ -1018,7 +1018,7 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
        const short do_light = (v3d->drawtype >= OB_SOLID);
 
        /* hide faces in face select mode */
-       if (draw_flags & DRAW_FACE_SELECT)
+       if (me->editflag & (ME_EDIT_PAINT_VERT_SEL | ME_EDIT_PAINT_FACE_SEL))
                facemask = wpaint__setSolidDrawOptions_facemask;
 
        if (ob->mode & OB_MODE_WEIGHT_PAINT) {
index 12dca8685c89144a4dc0dd12fdcbb7e732fe13df..01849429119e8115a285e9a59c664593d98d9c0b 100644 (file)
@@ -7103,7 +7103,21 @@ static DMDrawOption bbs_mesh_solid_hide2__setDrawOpts(void *userData, int index)
                return DM_DRAW_OPTION_SKIP;
        }
 }
-static void bbs_mesh_solid(Scene *scene, Object *ob)
+
+static void bbs_mesh_solid_verts(Scene *scene, Object *ob)
+{
+       Mesh *me = ob->data;
+       DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
+       glColor3ub(0, 0, 0);
+
+       dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, GPU_enable_material, NULL, me, 0);
+
+       bbs_obmode_mesh_verts(ob, dm, 1);
+       bm_vertoffs = me->totvert + 1;
+       dm->release(dm);
+}
+
+static void bbs_mesh_solid_faces(Scene *scene, Object *ob)
 {
        DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
        Mesh *me = (Mesh *)ob->data;
@@ -7168,18 +7182,10 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
                                    /* currently vertex select only supports weight paint */
                                    (ob->mode & OB_MODE_WEIGHT_PAINT))
                                {
-                                       DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
-                                       glColor3ub(0, 0, 0);
-
-                                       dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, GPU_enable_material, NULL, me, 0);
-
-
-                                       bbs_obmode_mesh_verts(ob, dm, 1);
-                                       bm_vertoffs = me->totvert + 1;
-                                       dm->release(dm);
+                                       bbs_mesh_solid_verts(scene, ob);
                                }
                                else {
-                                       bbs_mesh_solid(scene, ob);
+                                       bbs_mesh_solid_faces(scene, ob);
                                }
                        }
                        break;