creating the editmesh structure was running paint_facesel_test() for every vert and...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 14 Nov 2010 23:37:03 +0000 (23:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 14 Nov 2010 23:37:03 +0000 (23:37 +0000)
not so efficient, check once.

source/blender/editors/mesh/editmesh.c

index d95a2570e808b8348c474c6b54e5d0b3168eaacb..f8135e47d20dfe48b1e47de377b2c8c80a2575d9 100644 (file)
@@ -739,6 +739,7 @@ void make_editMesh(Scene *scene, Object *ob)
        EditSelection *ese;
        float *co, (*keyco)[3]= NULL;
        int tot, a, eekadoodle= 0;
+       const short is_paint_sel= paint_facesel_test(ob);
 
        if(me->edit_mesh==NULL)
                me->edit_mesh= MEM_callocN(sizeof(EditMesh), "editmesh");
@@ -789,7 +790,7 @@ void make_editMesh(Scene *scene, Object *ob)
                evlist[a]= eve;
                
                /* face select sets selection in next loop */
-               if(!paint_facesel_test(ob))
+               if(!is_paint_sel)
                        eve->f |= (mvert->flag & 1);
                
                if (mvert->flag & ME_HIDE) eve->h= 1;           
@@ -864,7 +865,7 @@ void make_editMesh(Scene *scene, Object *ob)
                                        if(mface->flag & ME_FACE_SEL) {
                                                efa->f |= SELECT;
                                                
-                                               if(paint_facesel_test(ob)) {
+                                               if(is_paint_sel) {
                                                        EM_select_face(efa, 1); /* flush down */
                                                }