fix for a bug painting on selected verts, also fix an error in my own recent commit.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 14 Sep 2011 12:44:21 +0000 (12:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 14 Sep 2011 12:44:21 +0000 (12:44 +0000)
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_view3d/drawobject.c

index ec2e976..62acacb 100644 (file)
@@ -442,7 +442,7 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
                        faceverts[2]= mface->v3;
                        faceverts[3]= mface->v4;
                        for (i=0; i<3 || faceverts[i]; i++) {
-                               if(me->dvert[faceverts[i]].flag) {
+                               if(!me->dvert[faceverts[i]].flag) {
                                        // Jason
                                        if(use_vert_sel && ((me->mvert[faceverts[i]].flag & SELECT) == 0)) {
                                                continue;
@@ -1927,10 +1927,16 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        mval[1]-= vc->ar->winrct.ymin;
                        
        swap_m4m4(wpd->vc.rv3d->persmat, mat);
-                       
+
+       // Jason
+       use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+
        /* which faces are involved */
        if(wp->flag & VP_AREA) {
+               // Ugly hack, to avoid drawing vertex index when getting the face index buffer - campbell
+               me->editflag &= ~ME_EDIT_VERT_SEL;
                totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush_size(brush));
+               me->editflag |= use_vert_sel ? ME_EDIT_VERT_SEL : 0;
        }
        else {
                indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
@@ -1949,9 +1955,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
                        }
                }
        }
-       // Jason
-       use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
-                       
+
        if((me->editflag & ME_EDIT_PAINT_MASK) && me->mface) {
                for(index=0; index<totindex; index++) {
                        if(indexar[index] && indexar[index]<=me->totface) {
index 2bded88..439f05c 100644 (file)
@@ -6719,7 +6719,6 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
                        Mesh *me= ob->data;
                        if(me->editflag & ME_EDIT_VERT_SEL) {
                                DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
-                               WM_set_framebuffer_index_color(me->totvert+2);
                                glColor3ub(0, 0, 0);
 
                                dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, me, 0, GPU_enable_material, NULL);