fix for long standing annoyance with weight-paint mode selection.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 1 Jan 2013 13:08:07 +0000 (13:08 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 1 Jan 2013 13:08:07 +0000 (13:08 +0000)
There was no selection flushing when faces or verts were selected, this allowed incorrect selection states like selected face with unselected vertices.

add flush commands to paintface_flush_flags() and paintvert_flush_flags()

source/blender/editors/mesh/editface.c
source/blender/makesrna/intern/rna_mesh.c

index 11226b38cbb6ca6c1bcbc365cb5c5da197070ac8..3fbfaabbc0d5f0fcfc7537705a41dcbe85298fcf 100644 (file)
@@ -69,7 +69,14 @@ void paintface_flush_flags(Object *ob)
        int totface, totpoly;
        int i;
        
-       if (me == NULL || dm == NULL)
+       if (me == NULL)
+               return;
+
+       /* we could call this directly in all areas that change selection,
+        * since this could become slow for realtime updates (circle-select for eg) */
+       BKE_mesh_flush_select_from_polys(me);
+
+       if (dm == NULL)
                return;
 
        /*
@@ -603,7 +610,14 @@ void paintvert_flush_flags(Object *ob)
        int totvert;
        int i;
 
-       if (me == NULL || dm == NULL)
+       if (me == NULL)
+               return;
+
+       /* we could call this directly in all areas that change selection,
+        * since this could become slow for realtime updates (circle-select for eg) */
+       BKE_mesh_flush_select_from_verts(me);
+
+       if (dm == NULL)
                return;
 
        index_array = dm->getVertDataArray(dm, CD_ORIGINDEX);
index 6f33f8c1db42760b3bd85af430ea6d74ec632962..e471bf3dd3cd00663cdd75890b78404561c41ffe 100644 (file)
@@ -154,7 +154,6 @@ static void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
        Mesh *me = ptr->data;
        if ((me->editflag & ME_EDIT_PAINT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_FACE_SEL)) {
                me->editflag &= ~ME_EDIT_PAINT_FACE_SEL;
-               BKE_mesh_flush_select_from_polys(me);
        }
        rna_Mesh_update_draw(bmain, scene, ptr);
 }
@@ -164,7 +163,6 @@ static void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
        Mesh *me = ptr->data;
        if ((me->editflag & ME_EDIT_PAINT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_FACE_SEL)) {
                me->editflag &= ~ME_EDIT_PAINT_VERT_SEL;
-               BKE_mesh_flush_select_from_verts(me);
        }
        rna_Mesh_update_draw(bmain, scene, ptr);
 }