rename BM_ flags for `BMHeader->hflag` to BM_ELEM_ to be more clear that these flags...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 12 Feb 2012 06:24:12 +0000 (06:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 12 Feb 2012 06:24:12 +0000 (06:24 +0000)
41 files changed:
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/bmesh/bmesh.h
source/blender/bmesh/bmesh_operator_api.h
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_eulers.c
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/bmesh/intern/bmesh_newcore.c
source/blender/bmesh/intern/bmesh_operators.c
source/blender/bmesh/operators/extrudeops.c
source/blender/bmesh/operators/join_triangles.c
source/blender/bmesh/operators/mesh_conv.c
source/blender/bmesh/operators/subdivideop.c
source/blender/bmesh/operators/utils.c
source/blender/bmesh/tools/BME_bevel.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/mesh/bmeshutils.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/render/render_shading.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/crazyspace.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/modifiers/intern/MOD_edgesplit.c

index c9ab126d7abfba5512d8931f459c2c2a36d59181..5d2392b790dcf244a1961ca27f0bc4f415a90e3e 100644 (file)
@@ -619,14 +619,14 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
                                                /*Start with the assumption the triangle should be included for snapping.*/
                                                insert = 1;
 
-                                               if (BM_TestHFlag(f, BM_SELECT) || BM_TestHFlag(f, BM_HIDDEN)) {
+                                               if (BM_TestHFlag(f, BM_ELEM_SELECT) || BM_TestHFlag(f, BM_ELEM_HIDDEN)) {
                                                        /*Don't insert triangles tesselated from faces that are hidden
                                                          or selected*/
                                                        insert = 0;
                                                }
                                                else {
                                                        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_FACE, f) {
-                                                               if (BM_TestHFlag(v, BM_SELECT)) {
+                                                               if (BM_TestHFlag(v, BM_ELEM_SELECT)) {
                                                                        /*Don't insert triangles tesselated from faces that have
                                                                          any selected verts.*/
                                                                        insert = 0;
index 2b2da712a1b91030898283288a1292491f0818c5..253d215ac584a85f3da0ced94990643caa2f4962 100644 (file)
@@ -553,7 +553,7 @@ static void emDM_drawUVEdges(DerivedMesh *dm)
                BMLoop *l;
                MLoopUV *lastluv = NULL, *firstluv = NULL;
 
-               if (BM_TestHFlag(efa, BM_HIDDEN))
+               if (BM_TestHFlag(efa, BM_ELEM_HIDDEN))
                        continue;
 
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -672,7 +672,7 @@ static void emDM_drawMappedFaces(
                        int drawSmooth;
 
                        efa = l[0]->f;
-                       drawSmooth= BM_TestHFlag(efa, BM_SMOOTH);
+                       drawSmooth= BM_TestHFlag(efa, BM_ELEM_SMOOTH);
 
                        draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, BM_GetIndex(efa), &drawSmooth);
                        if (draw) {
@@ -744,7 +744,7 @@ static void emDM_drawMappedFaces(
                        int drawSmooth;
 
                        efa = l[0]->f;
-                       drawSmooth= BM_TestHFlag(efa, BM_SMOOTH);
+                       drawSmooth= BM_TestHFlag(efa, BM_ELEM_SMOOTH);
 
                        draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, BM_GetIndex(efa), &drawSmooth);
                        if (draw) {
@@ -871,7 +871,7 @@ static void emDM_drawFacesTex_common(
                        MTexPoly *tp= CustomData_bmesh_get(&bm->pdata, ls[0]->f->head.data, CD_MTEXPOLY);
                        MTFace mtf = {{{0}}};
                        /*unsigned char *cp= NULL;*/ /*UNUSED*/
-                       int drawSmooth= BM_TestHFlag(ls[0]->f, BM_SMOOTH);
+                       int drawSmooth= BM_TestHFlag(ls[0]->f, BM_ELEM_SMOOTH);
                        int flag;
 
                        efa = ls[0]->f;
@@ -941,7 +941,7 @@ static void emDM_drawFacesTex_common(
                        MTexPoly *tp= CustomData_bmesh_get(&bm->pdata, ls[0]->f->head.data, CD_MTEXPOLY);
                        MTFace mtf = {{{0}}};
                        /*unsigned char *cp= NULL;*/ /*UNUSED*/
-                       int drawSmooth= BM_TestHFlag(ls[0]->f, BM_SMOOTH);
+                       int drawSmooth= BM_TestHFlag(ls[0]->f, BM_ELEM_SMOOTH);
                        int flag;
 
                        efa = ls[0]->f;
@@ -1095,7 +1095,7 @@ static void emDM_drawMappedFacesGLSL(
                int drawSmooth;
 
                efa = ltri[0]->f;
-               drawSmooth= BM_TestHFlag(efa, BM_SMOOTH);
+               drawSmooth= BM_TestHFlag(efa, BM_ELEM_SMOOTH);
 
                if (setDrawOptions && !setDrawOptions(userData, BM_GetIndex(efa)))
                        continue;
@@ -1217,7 +1217,7 @@ static void emDM_drawMappedFacesMat(
                int drawSmooth;
 
                efa = ltri[0]->f;
-               drawSmooth = BM_TestHFlag(efa, BM_SMOOTH);
+               drawSmooth = BM_TestHFlag(efa, BM_ELEM_SMOOTH);
 
                /* face hiding */
                if (setFace && !setFace(userData, BM_GetIndex(efa)))
index 54640328cacfe721b5b07c5f89dc64a72484e513..4d760fb49a36543fbb77a4d55a1dad64c8dab394 100644 (file)
@@ -83,24 +83,23 @@ struct EditMesh;
  *
 */
 
-/*BMHeader->htype (char) */
+/* BMHeader->htype (char) */
 #define BM_VERT        1
 #define BM_EDGE        2
 #define BM_LOOP        4
 #define BM_FACE        8
 #define BM_ALL         (BM_VERT | BM_EDGE | BM_LOOP | BM_FACE)
 
-/*BMHeader->hflag (char, all bits used!) */
-#define BM_SELECT      (1<<0)
-
-#define BM_SEAM                (1<<1)
-#define BM_HIDDEN      (1<<2)
-#define BM_SHARP       (1<<3)
-#define BM_SMOOTH      (1<<4)
-#define BM_TMP_TAG     (1<<5) /* internal flag, used for ensuring correct normals
-                            * during multires interpolation, and any other time
-                            * when temp tagging is handy.
-                            * always assume dirty & clear before use. */
+/* BMHeader->hflag (char, all bits used!) */
+#define BM_ELEM_SELECT (1<<0)
+#define BM_ELEM_HIDDEN (1<<1)
+#define BM_ELEM_SEAM   (1<<2)
+#define BM_ELEM_SHARP  (1<<3)
+#define BM_ELEM_SMOOTH (1<<4)
+#define BM_ELEM_TAG     (1<<5) /* internal flag, used for ensuring correct normals
+                                * during multires interpolation, and any other time
+                                * when temp tagging is handy.
+                                * always assume dirty & clear before use. */
 
 /* we have 2 spare flags which is awesome but since we're limited to 8
  * only add new flags with care! - campbell */
index 20fe1215a8c97e30e4d1e75defdd66f55b895179..52aa4ee38eca53117bb6467b85fc5cfc5f783cd7 100644 (file)
@@ -194,7 +194,7 @@ int BMO_CountFlag(struct BMesh *bm, const short oflag, const char htype);
  * this system is used to execute or initialize an operator,
  * using a formatted-string system.
  *
- * for example, BMO_CallOpf(bm, "del geom=%hf context=%d", BM_SELECT, DEL_FACES);
+ * for example, BMO_CallOpf(bm, "del geom=%hf context=%d", BM_ELEM_SELECT, DEL_FACES);
  * . . .will execute the delete operator, feeding in selected faces, deleting them.
  *
  * the basic format for the format string is:
@@ -319,7 +319,7 @@ void BMO_UnHeaderFlag_Buffer(struct BMesh *bm, struct BMOperator *op, const char
 
 /* puts every element of type type (which is a bitmask) with header flag
  * flag, into a slot.  note: ignores hidden elements (e.g. elements with
- * header flag BM_HIDDEN set).*/
+ * header flag BM_ELEM_HIDDEN set).*/
 void BMO_HeaderFlag_To_Slot(struct BMesh *bm, struct BMOperator *op, const char *slotname,
                             const char hflag, const char htype);
 
index 764bb62f09be636a051fd251a5d069260b1b66ff..6b2a81e976764a6f29c42f33e53bb5c6d5a876fe 100644 (file)
@@ -789,23 +789,23 @@ BMesh *BM_Copy_Mesh(BMesh *bmold)
 /* ME -> BM */
 char BM_Vert_Flag_From_MEFlag(const char  meflag)
 {
-       return ( ((meflag & SELECT)       ? BM_SELECT : 0) |
-                ((meflag & ME_HIDE)      ? BM_HIDDEN : 0)
+       return ( ((meflag & SELECT)       ? BM_ELEM_SELECT : 0) |
+                ((meflag & ME_HIDE)      ? BM_ELEM_HIDDEN : 0)
                 );
 }
 char BM_Edge_Flag_From_MEFlag(const short meflag)
 {
-       return ( ((meflag & SELECT)       ? BM_SELECT : 0) |
-                ((meflag & ME_SEAM)      ? BM_SEAM   : 0) |
-                ((meflag & ME_SHARP)     ? BM_SHARP  : 0) |
-                ((meflag & ME_HIDE)      ? BM_HIDDEN : 0)
+       return ( ((meflag & SELECT)       ? BM_ELEM_SELECT : 0) |
+                ((meflag & ME_SEAM)      ? BM_ELEM_SEAM   : 0) |
+                ((meflag & ME_SHARP)     ? BM_ELEM_SHARP  : 0) |
+                ((meflag & ME_HIDE)      ? BM_ELEM_HIDDEN : 0)
                 );
 }
 char BM_Face_Flag_From_MEFlag(const char  meflag)
 {
-       return ( ((meflag & ME_FACE_SEL)  ? BM_SELECT : 0) |
-                ((meflag & ME_SMOOTH)    ? BM_SMOOTH : 0) |
-                ((meflag & ME_HIDE)      ? BM_HIDDEN : 0)
+       return ( ((meflag & ME_FACE_SEL)  ? BM_ELEM_SELECT : 0) |
+                ((meflag & ME_SMOOTH)    ? BM_ELEM_SMOOTH : 0) |
+                ((meflag & ME_HIDE)      ? BM_ELEM_HIDDEN : 0)
                 );
 }
 
@@ -814,18 +814,18 @@ char  BM_Vert_Flag_To_MEFlag(BMVert *eve)
 {
        const char hflag = eve->head.hflag;
 
-       return ( ((hflag & BM_SELECT)  ? SELECT  : 0) |
-                ((hflag & BM_HIDDEN)  ? ME_HIDE : 0)
+       return ( ((hflag & BM_ELEM_SELECT)  ? SELECT  : 0) |
+                ((hflag & BM_ELEM_HIDDEN)  ? ME_HIDE : 0)
                 );
 }
 short BM_Edge_Flag_To_MEFlag(BMEdge *eed)
 {
        const char hflag = eed->head.hflag;
 
-       return ( ((hflag & BM_SELECT)       ? SELECT    : 0) |
-                ((hflag & BM_SEAM)         ? ME_SEAM   : 0) |
-                ((hflag & BM_SHARP)        ? ME_SHARP  : 0) |
-                ((hflag & BM_HIDDEN)       ? ME_HIDE   : 0) |
+       return ( ((hflag & BM_ELEM_SELECT)       ? SELECT    : 0) |
+                ((hflag & BM_ELEM_SEAM)         ? ME_SEAM   : 0) |
+                ((hflag & BM_ELEM_SHARP)        ? ME_SHARP  : 0) |
+                ((hflag & BM_ELEM_HIDDEN)       ? ME_HIDE   : 0) |
                 ((BM_Wire_Edge(NULL, eed)) ? ME_LOOSEEDGE : 0) | /* not typical */
                 (ME_EDGEDRAW | ME_EDGERENDER)
                 );
@@ -834,9 +834,9 @@ char  BM_Face_Flag_To_MEFlag(BMFace *efa)
 {
        const char hflag = efa->head.hflag;
 
-       return ( ((hflag & BM_SELECT) ? ME_FACE_SEL : 0) |
-                ((hflag & BM_SMOOTH) ? ME_SMOOTH   : 0) |
-                ((hflag & BM_HIDDEN) ? ME_HIDE     : 0)
+       return ( ((hflag & BM_ELEM_SELECT) ? ME_FACE_SEL : 0) |
+                ((hflag & BM_ELEM_SMOOTH) ? ME_SMOOTH   : 0) |
+                ((hflag & BM_ELEM_HIDDEN) ? ME_HIDE     : 0)
                 );
 }
 
index ba03ce31d8eab3eae57911216aaa372eede9a4cd..65cb2b3581f359b08d9e10626b24115c6f1d6205 100644 (file)
@@ -362,7 +362,7 @@ BMFace *bmesh_mf(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **elist, int len)
 int bmesh_kv(BMesh *bm, BMVert *v)
 {
        if(v->e == NULL) {
-               if (BM_TestHFlag(v, BM_SELECT)) bm->totvertsel--;
+               if (BM_TestHFlag(v, BM_ELEM_SELECT)) bm->totvertsel--;
 
                BLI_remlink(&(bm->verts), &(v->head));
                bmesh_free_vert(bm,v);
@@ -398,7 +398,7 @@ int bmesh_ke(BMesh *bm, BMEdge *e)
                if(edok) bmesh_error();
                
                /*remove and deallocate*/
-               if (BM_TestHFlag(e, BM_SELECT)) bm->totedgesel--;
+               if (BM_TestHFlag(e, BM_ELEM_SELECT)) bm->totedgesel--;
                BLI_remlink(&(bm->edges), &(e->head));
                bmesh_free_edge(bm, e);
                return 1;
@@ -438,7 +438,7 @@ int bmesh_kf(BMesh *bm, BMFace *bply)
                bply->loopbase = newbase;
        }
        
-       if (BM_TestHFlag(bply, BM_SELECT)) bm->totfacesel--;
+       if (BM_TestHFlag(bply, BM_ELEM_SELECT)) bm->totfacesel--;
        BLI_remlink(&(bm->polys), &(bply->head));
        bmesh_free_poly(bm, bply);
        return 1;
index a052fbf4038b5086309f16bf415e3decec9ca81a..ff52424ef12eede452344ff01744ec4fe88f08ab 100644 (file)
@@ -71,7 +71,7 @@ static void recount_totsels(BMesh *bm)
        for (i = 0; i < 3; i++) {
                ele = BMIter_New(&iter, bm, iter_types[i], NULL);
                for ( ; ele; ele = BMIter_Step(&iter)) {
-                       if (BM_TestHFlag(ele, BM_SELECT)) *tots[i] += 1;
+                       if (BM_TestHFlag(ele, BM_ELEM_SELECT)) *tots[i] += 1;
                }
        }
 }
@@ -90,19 +90,19 @@ void BM_SelectMode_Flush(BMesh *bm)
 
        if (bm->selectmode & SCE_SELECT_VERTEX) {
                for (e = BMIter_New(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BMIter_Step(&edges)) {
-                       if (BM_TestHFlag(e->v1, BM_SELECT) && BM_TestHFlag(e->v2, BM_SELECT) && !BM_TestHFlag(e, BM_HIDDEN)) {
-                               BM_SetHFlag(e, BM_SELECT);
+                       if (BM_TestHFlag(e->v1, BM_ELEM_SELECT) && BM_TestHFlag(e->v2, BM_ELEM_SELECT) && !BM_TestHFlag(e, BM_ELEM_HIDDEN)) {
+                               BM_SetHFlag(e, BM_ELEM_SELECT);
                        }
                        else {
-                               BM_ClearHFlag(e, BM_SELECT);
+                               BM_ClearHFlag(e, BM_ELEM_SELECT);
                        }
                }
                for (f = BMIter_New(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BMIter_Step(&faces)) {
                        ok = TRUE;
-                       if (!BM_TestHFlag(f, BM_HIDDEN)) {
+                       if (!BM_TestHFlag(f, BM_ELEM_HIDDEN)) {
                                l_iter = l_first = BM_FACE_FIRST_LOOP(f);
                                do {
-                                       if (!BM_TestHFlag(l_iter->v, BM_SELECT)) {
+                                       if (!BM_TestHFlag(l_iter->v, BM_ELEM_SELECT)) {
                                                ok = FALSE;
                                                break;
                                        }
@@ -113,20 +113,20 @@ void BM_SelectMode_Flush(BMesh *bm)
                        }
 
                        if (ok) {
-                               BM_SetHFlag(f, BM_SELECT);
+                               BM_SetHFlag(f, BM_ELEM_SELECT);
                        }
                        else {
-                               BM_ClearHFlag(f, BM_SELECT);
+                               BM_ClearHFlag(f, BM_ELEM_SELECT);
                        }
                }
        }
        else if (bm->selectmode & SCE_SELECT_EDGE) {
                for (f = BMIter_New(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BMIter_Step(&faces)) {
                        ok = TRUE;
-                       if (!BM_TestHFlag(f, BM_HIDDEN)) {
+                       if (!BM_TestHFlag(f, BM_ELEM_HIDDEN)) {
                                l_iter = l_first = BM_FACE_FIRST_LOOP(f);
                                do {
-                                       if (!BM_TestHFlag(&(l_iter->e->head), BM_SELECT)) {
+                                       if (!BM_TestHFlag(&(l_iter->e->head), BM_ELEM_SELECT)) {
                                                ok = FALSE;
                                                break;
                                        }
@@ -137,10 +137,10 @@ void BM_SelectMode_Flush(BMesh *bm)
                        }
 
                        if (ok) {
-                               BM_SetHFlag(f, BM_SELECT);
+                               BM_SetHFlag(f, BM_ELEM_SELECT);
                        }
                        else {
-                               BM_ClearHFlag(f, BM_SELECT);
+                               BM_ClearHFlag(f, BM_ELEM_SELECT);
                        }
                }
        }
@@ -165,17 +165,17 @@ void BM_DeSelect_Flush(BMesh *bm)
        int ok;
 
        for (e = BMIter_New(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BMIter_Step(&edges)) {
-               if (!(BM_TestHFlag(e->v1, BM_SELECT) && BM_TestHFlag(e->v2, BM_SELECT) && !BM_TestHFlag(e, BM_HIDDEN))) {
-                       BM_ClearHFlag(e, BM_SELECT);
+               if (!(BM_TestHFlag(e->v1, BM_ELEM_SELECT) && BM_TestHFlag(e->v2, BM_ELEM_SELECT) && !BM_TestHFlag(e, BM_ELEM_HIDDEN))) {
+                       BM_ClearHFlag(e, BM_ELEM_SELECT);
                }
        }
 
        for (f = BMIter_New(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BMIter_Step(&faces)) {
                ok = TRUE;
-               if (!BM_TestHFlag(f, BM_HIDDEN)) {
+               if (!BM_TestHFlag(f, BM_ELEM_HIDDEN)) {
                        l_iter = l_first = BM_FACE_FIRST_LOOP(f);
                        do {
-                               if (!BM_TestHFlag(l_iter->v, BM_SELECT)) {
+                               if (!BM_TestHFlag(l_iter->v, BM_ELEM_SELECT)) {
                                        ok = FALSE;
                                        break;
                                }
@@ -186,7 +186,7 @@ void BM_DeSelect_Flush(BMesh *bm)
                }
 
                if (ok == FALSE) {
-                       BM_ClearHFlag(f, BM_SELECT);
+                       BM_ClearHFlag(f, BM_ELEM_SELECT);
                }
        }
 
@@ -211,17 +211,17 @@ void BM_Select_Flush(BMesh *bm)
        int ok;
 
        for (e = BMIter_New(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BMIter_Step(&edges)) {
-               if (BM_TestHFlag(e->v1, BM_SELECT) && BM_TestHFlag(e->v2, BM_SELECT) && !BM_TestHFlag(e, BM_HIDDEN)) {
-                       BM_SetHFlag(e, BM_SELECT);
+               if (BM_TestHFlag(e->v1, BM_ELEM_SELECT) && BM_TestHFlag(e->v2, BM_ELEM_SELECT) && !BM_TestHFlag(e, BM_ELEM_HIDDEN)) {
+                       BM_SetHFlag(e, BM_ELEM_SELECT);
                }
        }
 
        for (f = BMIter_New(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BMIter_Step(&faces)) {
                ok = TRUE;
-               if (!BM_TestHFlag(f, BM_HIDDEN)) {
+               if (!BM_TestHFlag(f, BM_ELEM_HIDDEN)) {
                        l_iter = l_first = BM_FACE_FIRST_LOOP(f);
                        do {
-                               if (!BM_TestHFlag(l_iter->v, BM_SELECT)) {
+                               if (!BM_TestHFlag(l_iter->v, BM_ELEM_SELECT)) {
                                        ok = FALSE;
                                        break;
                                }
@@ -232,7 +232,7 @@ void BM_Select_Flush(BMesh *bm)
                }
 
                if (ok) {
-                       BM_SetHFlag(f, BM_SELECT);
+                       BM_SetHFlag(f, BM_ELEM_SELECT);
                }
        }
 
@@ -253,20 +253,20 @@ void BM_Select_Vert(BMesh *bm, BMVert *v, int select)
        /* BMIter iter; */
        /* BMEdge *e; */
 
-       if (BM_TestHFlag(v, BM_HIDDEN)) {
+       if (BM_TestHFlag(v, BM_ELEM_HIDDEN)) {
                return;
        }
 
        if (select) {
-               if (!BM_TestHFlag(v, BM_SELECT)) {
+               if (!BM_TestHFlag(v, BM_ELEM_SELECT)) {
                        bm->totvertsel += 1;
-                       BM_SetHFlag(v, BM_SELECT);
+                       BM_SetHFlag(v, BM_ELEM_SELECT);
                }
        }
        else {
-               if (BM_TestHFlag(v, BM_SELECT)) {
+               if (BM_TestHFlag(v, BM_ELEM_SELECT)) {
                        bm->totvertsel -= 1;
-                       BM_ClearHFlag(v, BM_SELECT);
+                       BM_ClearHFlag(v, BM_ELEM_SELECT);
                }
        }
 }
@@ -281,20 +281,20 @@ void BM_Select_Vert(BMesh *bm, BMVert *v, int select)
 
 void BM_Select_Edge(BMesh *bm, BMEdge *e, int select)
 {
-       if (BM_TestHFlag(e, BM_HIDDEN)) {
+       if (BM_TestHFlag(e, BM_ELEM_HIDDEN)) {
                return;
        }
 
        if (select) {
-               if (!BM_TestHFlag(e, BM_SELECT)) bm->totedgesel += 1;
+               if (!BM_TestHFlag(e, BM_ELEM_SELECT)) bm->totedgesel += 1;
 
-               BM_SetHFlag(&(e->head), BM_SELECT);
+               BM_SetHFlag(&(e->head), BM_ELEM_SELECT);
                BM_Select(bm, e->v1, TRUE);
                BM_Select(bm, e->v2, TRUE);
        }
        else {
-               if (BM_TestHFlag(e, BM_SELECT)) bm->totedgesel -= 1;
-               BM_ClearHFlag(&(e->head), BM_SELECT);
+               if (BM_TestHFlag(e, BM_ELEM_SELECT)) bm->totedgesel -= 1;
+               BM_ClearHFlag(&(e->head), BM_ELEM_SELECT);
 
                if ( bm->selectmode == SCE_SELECT_EDGE ||
                     bm->selectmode == SCE_SELECT_FACE ||
@@ -314,7 +314,7 @@ void BM_Select_Edge(BMesh *bm, BMEdge *e, int select)
                                                continue;
                                        }
 
-                                       if (BM_TestHFlag(e2, BM_SELECT)) {
+                                       if (BM_TestHFlag(e2, BM_ELEM_SELECT)) {
                                                deselect = 0;
                                                break;
                                        }
@@ -345,14 +345,14 @@ void BM_Select_Face(BMesh *bm, BMFace *f, int select)
        BMLoop *l_iter;
        BMLoop *l_first;
 
-       if (BM_TestHFlag(f, BM_HIDDEN)) {
+       if (BM_TestHFlag(f, BM_ELEM_HIDDEN)) {
                return;
        }
 
        if (select) {
-               if (!BM_TestHFlag(f, BM_SELECT)) bm->totfacesel += 1;
+               if (!BM_TestHFlag(f, BM_ELEM_SELECT)) bm->totfacesel += 1;
 
-               BM_SetHFlag(&(f->head), BM_SELECT);
+               BM_SetHFlag(&(f->head), BM_ELEM_SELECT);
                l_iter = l_first = BM_FACE_FIRST_LOOP(f);
                do {
                        BM_Select_Vert(bm, l_iter->v, TRUE);
@@ -363,15 +363,15 @@ void BM_Select_Face(BMesh *bm, BMFace *f, int select)
                BMIter liter;
                BMLoop *l;
 
-               if (BM_TestHFlag(f, BM_SELECT)) bm->totfacesel -= 1;
-               BM_ClearHFlag(&(f->head), BM_SELECT);
+               if (BM_TestHFlag(f, BM_ELEM_SELECT)) bm->totfacesel -= 1;
+               BM_ClearHFlag(&(f->head), BM_ELEM_SELECT);
 
                /* flush down to edges */
                BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
                        BMIter fiter;
                        BMFace *f2;
                        BM_ITER(f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) {
-                               if (BM_TestHFlag(f2, BM_SELECT))
+                               if (BM_TestHFlag(f2, BM_ELEM_SELECT))
                                        break;
                        }
 
@@ -386,7 +386,7 @@ void BM_Select_Face(BMesh *bm, BMFace *f, int select)
                        BMIter eiter;
                        BMEdge *e;
                        BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, l->v) {
-                               if (BM_TestHFlag(e, BM_SELECT))
+                               if (BM_TestHFlag(e, BM_ELEM_SELECT))
                                        break;
                        }
 
@@ -427,7 +427,7 @@ void BM_Selectmode_Set(BMesh *bm, int selectmode)
                for (v = BMIter_New(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BMIter_Step(&verts))
                        BM_ClearHFlag(v, 0);
                for (e = BMIter_New(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BMIter_Step(&edges)) {
-                       if (BM_TestHFlag(&(e->head), BM_SELECT)) {
+                       if (BM_TestHFlag(&(e->head), BM_ELEM_SELECT)) {
                                BM_Select_Edge(bm, e, TRUE);
                        }
                }
@@ -437,7 +437,7 @@ void BM_Selectmode_Set(BMesh *bm, int selectmode)
                for (e = BMIter_New(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BMIter_Step(&edges))
                        BM_ClearHFlag(e, 0);
                for (f = BMIter_New(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BMIter_Step(&faces)) {
-                       if (BM_TestHFlag(&(f->head), BM_SELECT)) {
+                       if (BM_TestHFlag(&(f->head), BM_ELEM_SELECT)) {
                                BM_Select_Face(bm, f, TRUE);
                        }
                }
@@ -454,19 +454,19 @@ int BM_CountFlag(struct BMesh *bm, const char htype, const char hflag, int respe
 
        if (htype & BM_VERT) {
                for (head = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL); head; head = BMIter_Step(&iter)) {
-                       if (respecthide && BM_TestHFlag(head, BM_HIDDEN)) continue;
+                       if (respecthide && BM_TestHFlag(head, BM_ELEM_HIDDEN)) continue;
                        if (BM_TestHFlag(head, hflag)) tot++;
                }
        }
        if (htype & BM_EDGE) {
                for (head = BMIter_New(&iter, bm, BM_EDGES_OF_MESH, NULL); head; head = BMIter_Step(&iter)) {
-                       if (respecthide && BM_TestHFlag(head, BM_HIDDEN)) continue;
+                       if (respecthide && BM_TestHFlag(head, BM_ELEM_HIDDEN)) continue;
                        if (BM_TestHFlag(head, hflag)) tot++;
                }
        }
        if (htype & BM_FACE) {
                for (head = BMIter_New(&iter, bm, BM_FACES_OF_MESH, NULL); head; head = BMIter_Step(&iter)) {
-                       if (respecthide && BM_TestHFlag(head, BM_HIDDEN)) continue;
+                       if (respecthide && BM_TestHFlag(head, BM_ELEM_HIDDEN)) continue;
                        if (BM_TestHFlag(head, hflag)) tot++;
                }
        }
@@ -487,8 +487,8 @@ void BM_Select(struct BMesh *bm, void *element, int select)
 int BM_Selected(BMesh *UNUSED(bm), const void *element)
 {
        const BMHeader *head = element;
-       int selected = BM_TestHFlag(head, BM_SELECT);
-       BLI_assert(!selected || !BM_TestHFlag(head, BM_HIDDEN));
+       int selected = BM_TestHFlag(head, BM_ELEM_SELECT);
+       BLI_assert(!selected || !BM_TestHFlag(head, BM_ELEM_HIDDEN));
        return selected;
 }
 
@@ -514,7 +514,7 @@ BMFace *BM_get_actFace(BMesh *bm, int sloppy)
                        if (ese->htype == BM_FACE) {
                                f = (BMFace *)ese->data;
                                
-                               if (BM_TestHFlag(f, BM_HIDDEN)) {
+                               if (BM_TestHFlag(f, BM_ELEM_HIDDEN)) {
                                        f = NULL;
                                }
                                else {
@@ -525,7 +525,7 @@ BMFace *BM_get_actFace(BMesh *bm, int sloppy)
                /* Last attempt: try to find any selected face */
                if (f == NULL) {
                        BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-                               if (BM_TestHFlag(f, BM_SELECT)) {
+                               if (BM_TestHFlag(f, BM_ELEM_SELECT)) {
                                        break;
                                }
                        }
@@ -739,7 +739,7 @@ void BM_validate_selections(BMesh *bm)
 
        while (ese) {
                nextese = ese->next;
-               if (!BM_TestHFlag(ese->data, BM_SELECT)) {
+               if (!BM_TestHFlag(ese->data, BM_ELEM_SELECT)) {
                        BLI_freelinkN(&(bm->selected), ese);
                }
                ese = nextese;
@@ -755,14 +755,14 @@ void BM_clear_flag_all(BMesh *bm, const char hflag)
        BMHeader *ele;
        int i;
 
-       if (hflag & BM_SELECT) {
+       if (hflag & BM_ELEM_SELECT) {
                BM_clear_selection_history(bm);
        }
 
        for (i = 0; i < 3; i++) {
                ele = BMIter_New(&iter, bm, iter_types[i], NULL);
                for ( ; ele; ele = BMIter_Step(&iter)) {
-                       if (hflag & BM_SELECT) BM_Select(bm, ele, FALSE);
+                       if (hflag & BM_ELEM_SELECT) BM_Select(bm, ele, FALSE);
                        BM_ClearHFlag(ele, hflag);
                }
        }
@@ -771,7 +771,7 @@ void BM_clear_flag_all(BMesh *bm, const char hflag)
 
 /***************** Mesh Hiding stuff *********** */
 
-#define SETHIDE(ele) hide ? BM_SetHFlag(ele, BM_HIDDEN) : BM_ClearHFlag(ele, BM_HIDDEN);
+#define SETHIDE(ele) hide ? BM_SetHFlag(ele, BM_ELEM_HIDDEN) : BM_ClearHFlag(ele, BM_ELEM_HIDDEN);
 
 static void vert_flush_hide(BMesh *bm, BMVert *v)
 {
@@ -780,7 +780,7 @@ static void vert_flush_hide(BMesh *bm, BMVert *v)
        int hide = 1;
 
        BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) {
-               hide = hide && BM_TestHFlag(e, BM_HIDDEN);
+               hide = hide && BM_TestHFlag(e, BM_ELEM_HIDDEN);
        }
 
        SETHIDE(v);
@@ -793,7 +793,7 @@ static void edge_flush_hide(BMesh *bm, BMEdge *e)
        int hide = 1;
 
        BM_ITER(f, &iter, bm, BM_FACES_OF_EDGE, e) {
-               hide = hide && BM_TestHFlag(f, BM_HIDDEN);
+               hide = hide && BM_TestHFlag(f, BM_ELEM_HIDDEN);
        }
 
        SETHIDE(e);
index 6fc9dec4eed71a9ffa6fad15ce1b8c1783eef58f..9a4761b233086c59b182389d7055ef772653e2fc 100644 (file)
@@ -233,7 +233,7 @@ void BM_Compute_Normals(BMesh *bm)
 
        /* first, find out the largest face in mesh */
        BM_ITER(f, &faces, bm, BM_FACES_OF_MESH, NULL) {
-               if (BM_TestHFlag(f, BM_HIDDEN))
+               if (BM_TestHFlag(f, BM_ELEM_HIDDEN))
                        continue;
 
                if (f->len > maxlength) maxlength = f->len;
@@ -247,7 +247,7 @@ void BM_Compute_Normals(BMesh *bm)
        
        /* calculate all face normals */
        BM_ITER(f, &faces, bm, BM_FACES_OF_MESH, NULL) {
-               if (BM_TestHFlag(f, BM_HIDDEN))
+               if (BM_TestHFlag(f, BM_ELEM_HIDDEN))
                        continue;
 #if 0  /* UNUSED */
                if (f->head.flag & BM_NONORMCALC)
@@ -259,7 +259,7 @@ void BM_Compute_Normals(BMesh *bm)
        
        /* Zero out vertex normals */
        BM_ITER(v, &verts, bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_HIDDEN))
+               if (BM_TestHFlag(v, BM_ELEM_HIDDEN))
                        continue;
 
                zero_v3(v->no);
@@ -288,7 +288,7 @@ void BM_Compute_Normals(BMesh *bm)
        /* add weighted face normals to vertices */
        BM_ITER(f, &faces, bm, BM_FACES_OF_MESH, NULL) {
 
-               if (BM_TestHFlag(f, BM_HIDDEN))
+               if (BM_TestHFlag(f, BM_ELEM_HIDDEN))
                        continue;
 
                BM_ITER(l, &loops, bm, BM_LOOPS_OF_FACE, f) {
@@ -318,7 +318,7 @@ void BM_Compute_Normals(BMesh *bm)
        
        /* normalize the accumulated vertex normals */
        BM_ITER(v, &verts, bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_HIDDEN))
+               if (BM_TestHFlag(v, BM_ELEM_HIDDEN))
                        continue;
 
                if (normalize_v3(v->no) == 0.0f) {
@@ -332,7 +332,7 @@ void BM_Compute_Normals(BMesh *bm)
 
 /*
  This function ensures correct normals for the mesh, but
- sets the flag BM_TMP_TAG in flipped faces, to allow restoration
+ sets the flag BM_ELEM_TAG in flipped faces, to allow restoration
  of original normals.
  
  if undo is 0: calculate right normals
@@ -348,10 +348,10 @@ static void bmesh_rationalize_normals(BMesh *bm, int undo)
        
        if (undo) {
                BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(f, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(f, BM_ELEM_TAG)) {
                                BM_flip_normal(bm, f);
                        }
-                       BM_ClearHFlag(f, BM_TMP_TAG);
+                       BM_ClearHFlag(f, BM_ELEM_TAG);
                }
                
                return;
@@ -364,8 +364,8 @@ static void bmesh_rationalize_normals(BMesh *bm, int undo)
        
        BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
                if (BMO_TestFlag(bm, f, FACE_FLIP))
-                       BM_SetHFlag(f, BM_TMP_TAG);
-               else BM_ClearHFlag(f, BM_TMP_TAG);
+                       BM_SetHFlag(f, BM_ELEM_TAG);
+               else BM_ClearHFlag(f, BM_ELEM_TAG);
        }
 
        BMO_pop(bm);
index 4849b41a1119b4c50f0c67a44a46072becfb4c04..5982a9eae48a126e92f4f962124774aff34906d6 100644 (file)
@@ -1556,21 +1556,21 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
 
        /* validate no internal join */
        for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, l_iter = l_iter->next) {
-               BM_ClearHFlag(l_iter->v, BM_TMP_TAG);
+               BM_ClearHFlag(l_iter->v, BM_ELEM_TAG);
        }
        for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, l_iter = l_iter->next) {
-               BM_ClearHFlag(l_iter->v, BM_TMP_TAG);
+               BM_ClearHFlag(l_iter->v, BM_ELEM_TAG);
        }
 
        for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, l_iter = l_iter->next) {
                if (l_iter != f1loop) {
-                       BM_SetHFlag(l_iter->v, BM_TMP_TAG);
+                       BM_SetHFlag(l_iter->v, BM_ELEM_TAG);
                }
        }
        for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, l_iter = l_iter->next) {
                if (l_iter != f2loop) {
                        /* as soon as a duplicate is found, bail out */
-                       if (BM_TestHFlag(l_iter->v, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(l_iter->v, BM_ELEM_TAG)) {
                                return NULL;
                        }
                }
index 9265f8cba8577afdbf3fe64bb69f2d4e86724d33..8c761cff644dad6483c6f4e53951abbd86421449 100644 (file)
@@ -633,7 +633,7 @@ void BMO_HeaderFlag_To_Slot(BMesh *bm, BMOperator *op, const char *slotname,
 
                if (htype & BM_VERT) {
                        for (e = BMIter_New(&elements, bm, BM_VERTS_OF_MESH, bm); e; e = BMIter_Step(&elements)) {
-                               if (!BM_TestHFlag(e, BM_HIDDEN) && BM_TestHFlag(e, hflag)) {
+                               if (!BM_TestHFlag(e, BM_ELEM_HIDDEN) && BM_TestHFlag(e, hflag)) {
                                        ((BMHeader **)output->data.p)[i] = e;
                                        i++;
                                }
@@ -642,7 +642,7 @@ void BMO_HeaderFlag_To_Slot(BMesh *bm, BMOperator *op, const char *slotname,
 
                if (htype & BM_EDGE) {
                        for (e = BMIter_New(&elements, bm, BM_EDGES_OF_MESH, bm); e; e = BMIter_Step(&elements)) {
-                               if (!BM_TestHFlag(e, BM_HIDDEN) && BM_TestHFlag(e, hflag)) {
+                               if (!BM_TestHFlag(e, BM_ELEM_HIDDEN) && BM_TestHFlag(e, hflag)) {
                                        ((BMHeader **)output->data.p)[i] = e;
                                        i++;
                                }
@@ -651,7 +651,7 @@ void BMO_HeaderFlag_To_Slot(BMesh *bm, BMOperator *op, const char *slotname,
 
                if (htype & BM_FACE) {
                        for (e = BMIter_New(&elements, bm, BM_FACES_OF_MESH, bm); e; e = BMIter_Step(&elements)) {
-                               if (!BM_TestHFlag(e, BM_HIDDEN) && BM_TestHFlag(e, hflag)) {
+                               if (!BM_TestHFlag(e, BM_ELEM_HIDDEN) && BM_TestHFlag(e, hflag)) {
                                        ((BMHeader **)output->data.p)[i] = e;
                                        i++;
                                }
@@ -730,7 +730,7 @@ void BMO_HeaderFlag_Buffer(BMesh *bm, BMOperator *op, const char *slotname,
                if (!(htype & data[i]->htype))
                        continue;
 
-               if (hflag & BM_SELECT) {
+               if (hflag & BM_ELEM_SELECT) {
                        BM_Select(bm, data[i], TRUE);
                }
                BM_SetHFlag(data[i], hflag);
@@ -755,7 +755,7 @@ void BMO_UnHeaderFlag_Buffer(BMesh *bm, BMOperator *op, const char *slotname,
                if (!(htype & data[i]->htype))
                        continue;
 
-               if (hflag & BM_SELECT) {
+               if (hflag & BM_ELEM_SELECT) {
                        BM_Select(bm, data[i], FALSE);
                }
 
@@ -1098,7 +1098,7 @@ int BMO_PopError(BMesh *bm, const char **msg, BMOperator **op)
 }
 
 /* example:
- * BMO_CallOp(bm, "del %d %hv", DEL_ONLYFACES, BM_SELECT);
+ * BMO_CallOp(bm, "del %d %hv", DEL_ONLYFACES, BM_ELEM_SELECT);
  *
  *  d - int
  *  i - int
index 79671abd4fd34ba226198e33054f8e8d4aca5838..4a2aea945d42e8b2427ea7473fd8286f672d660a 100644 (file)
@@ -368,7 +368,7 @@ static void calc_solidify_normals(BMesh *bm)
        int *edge_face_count = MEM_callocN(sizeof(int) * bm->totedge, __func__);
 
        BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) {
-               BM_SetHFlag(v, BM_TMP_TAG);
+               BM_SetHFlag(v, BM_ELEM_TAG);
        }
 
        BM_ElemIndex_Ensure(bm, BM_EDGE);
@@ -461,8 +461,8 @@ static void calc_solidify_normals(BMesh *bm)
                        else {
                                /* can't do anything useful here!
                                 * Set the face index for a vert incase it gets a zero normal */
-                               BM_ClearHFlag(e->v1, BM_TMP_TAG);
-                               BM_ClearHFlag(e->v2, BM_TMP_TAG);
+                               BM_ClearHFlag(e->v1, BM_ELEM_TAG);
+                               BM_ClearHFlag(e->v2, BM_ELEM_TAG);
                                continue;
                        }
                }
@@ -488,7 +488,7 @@ static void calc_solidify_normals(BMesh *bm)
                        /* use standard normals for vertices connected to non-manifold edges */
                        BM_Vert_UpdateNormal(bm, v);
                }
-               else if (normalize_v3(v->no) == 0.0f && !BM_TestHFlag(v, BM_TMP_TAG)) {
+               else if (normalize_v3(v->no) == 0.0f && !BM_TestHFlag(v, BM_ELEM_TAG)) {
                        /* exceptional case, totally flat. use the normal
                         * of any marked face around the vertex */
                        BM_ITER(f, &fiter, bm, BM_FACES_OF_VERT, v) {
index f8c162d62f0d38bc657741a86beef63dae545315..36f9ea1b4f49719c2620df5a957c8292d4eac358 100644 (file)
@@ -285,7 +285,7 @@ void bmesh_jointriangles_exec(BMesh *bm, BMOperator *op)
                v3 = e->l->next->v;
                v4 = e->l->radial_next->prev->v;
 
-               if (dosharp && BM_TestHFlag(e, BM_SHARP))
+               if (dosharp && BM_TestHFlag(e, BM_ELEM_SHARP))
                        continue;
                
                if ((douvs || dovcols) && compareFaceAttribs(bm, e, douvs, dovcols))
index e71d181e5e601f41c67a395bb678f9219682017d..bc1829d6fb81318904b77169eef01b4ea2a0ab55 100644 (file)
@@ -151,7 +151,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
                v->head.hflag = BM_Vert_Flag_From_MEFlag(mvert->flag);
 
                /* this is necassary for selection counts to work properl */
-               if (BM_TestHFlag(v, BM_SELECT)) BM_Select_Vert(bm, v, TRUE);
+               if (BM_TestHFlag(v, BM_ELEM_SELECT)) BM_Select_Vert(bm, v, TRUE);
 
                normal_short_to_float_v3(v->no, mvert->no);
 
@@ -197,7 +197,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
                e->head.hflag = BM_Edge_Flag_From_MEFlag(medge->flag);
 
                /* this is necassary for selection counts to work properly */
-               if (BM_TestHFlag(e, BM_SELECT)) BM_Select(bm, e, TRUE);
+               if (BM_TestHFlag(e, BM_ELEM_SELECT)) BM_Select(bm, e, TRUE);
                
                /* Copy Custom Dat */
                CustomData_to_bmesh_block(&me->edata, &bm->edata, i, &e->head.data);
@@ -267,7 +267,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
                f->head.hflag = BM_Face_Flag_From_MEFlag(mpoly->flag);
 
                /* this is necassary for selection counts to work properl */
-               if (BM_TestHFlag(f, BM_SELECT)) BM_Select(bm, f, TRUE);
+               if (BM_TestHFlag(f, BM_ELEM_SELECT)) BM_Select(bm, f, TRUE);
 
                f->mat_nr = mpoly->mat_nr;
                if (i == me->act_face) bm->act_face = f;
index 0ad8c80ab6a4cd945f3e9ee7c4fcb4c74d007955..204ec9da09ee2f7d9f834b2f391da8872905cb30 100644 (file)
@@ -1045,7 +1045,7 @@ void BM_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float smooth
                // int i;
                
                /* deselect inpu */
-               BM_clear_flag_all(bm, BM_SELECT);
+               BM_clear_flag_all(bm, BM_ELEM_SELECT);
 
                ele = BMO_IterNew(&iter, bm, &op, "outinner", BM_EDGE|BM_VERT);
                for ( ; ele; ele = BMO_IterStep(&iter)) {
@@ -1056,16 +1056,16 @@ void BM_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float smooth
                                BMIter eiter;
 
                                BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, ele) {
-                                       if (!BM_TestHFlag(e, BM_SELECT) &&
-                                            BM_TestHFlag(e->v1, BM_SELECT) &&
-                                            BM_TestHFlag(e->v2, BM_SELECT))
+                                       if (!BM_TestHFlag(e, BM_ELEM_SELECT) &&
+                                            BM_TestHFlag(e->v1, BM_ELEM_SELECT) &&
+                                            BM_TestHFlag(e->v2, BM_ELEM_SELECT))
                                        {
                                                BM_Select(bm, e, TRUE);
                                                bm->totedgesel += 1;
                                        }
-                                       else if (BM_TestHFlag(e, BM_SELECT) &&
-                                                (!BM_TestHFlag(e->v1, BM_SELECT) ||
-                                                 !BM_TestHFlag(e->v2, BM_SELECT)))
+                                       else if (BM_TestHFlag(e, BM_ELEM_SELECT) &&
+                                                (!BM_TestHFlag(e->v1, BM_ELEM_SELECT) ||
+                                                 !BM_TestHFlag(e->v2, BM_ELEM_SELECT)))
                                        {
                                                BM_Select(bm, e, FALSE);
                                                bm->totedgesel -= 1;
index d7c7646cd318b832ed1981e993167ecebbcdc131..27cad5bf439f557f6765e7382719e1acd2c1749f 100644 (file)
@@ -260,7 +260,7 @@ void bmesh_regionextend_exec(BMesh *bm, BMOperator *op)
 /* NOTE: this function uses recursion, which is a little unusual for a bmop
  *       function, but acceptable I think. */
 
-/* NOTE: BM_TMP_TAG is used on faces to tell if they are flipped. */
+/* NOTE: BM_ELEM_TAG is used on faces to tell if they are flipped. */
 
 void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op)
 {
@@ -281,7 +281,7 @@ void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op)
        BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) {
 
                /* clear dirty flag */
-               BM_ClearHFlag(f, BM_TMP_TAG);
+               BM_ClearHFlag(f, BM_ELEM_TAG);
 
                if (BMO_TestFlag(bm, f, FACE_VIS))
                        continue;
@@ -307,7 +307,7 @@ void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op)
                BMO_ToggleFlag(bm, startf, FACE_FLIP);
 
                if (flagflip)
-                       BM_ToggleHFlag(startf, BM_TMP_TAG);
+                       BM_ToggleHFlag(startf, BM_ELEM_TAG);
        }
        
        /* now that we've found our starting face, make all connected faces
@@ -339,12 +339,12 @@ void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op)
                                                
                                                BMO_ToggleFlag(bm, l2->f, FACE_FLIP);
                                                if (flagflip)
-                                                       BM_ToggleHFlag(l2->f, BM_TMP_TAG);
+                                                       BM_ToggleHFlag(l2->f, BM_ELEM_TAG);
                                        }
-                                       else if (BM_TestHFlag(l2->f, BM_TMP_TAG) || BM_TestHFlag(l->f, BM_TMP_TAG)) {
+                                       else if (BM_TestHFlag(l2->f, BM_ELEM_TAG) || BM_TestHFlag(l->f, BM_ELEM_TAG)) {
                                                if (flagflip) {
-                                                       BM_ClearHFlag(l->f, BM_TMP_TAG);
-                                                       BM_ClearHFlag(l2->f, BM_TMP_TAG);
+                                                       BM_ClearHFlag(l->f, BM_ELEM_TAG);
+                                                       BM_ClearHFlag(l2->f, BM_ELEM_TAG);
                                                }
                                        }
                                        
@@ -593,7 +593,7 @@ void bmesh_similarfaces_exec(BMesh *bm, BMOperator *op)
        /* now select the rest (if any) */
        for (i = 0; i < num_total; i++) {
                fm = f_ext[i].f;
-               if (!BMO_TestFlag(bm, fm, FACE_MARK)  && !BM_TestHFlag(fm, BM_HIDDEN)) {
+               if (!BMO_TestFlag(bm, fm, FACE_MARK)  && !BM_TestHFlag(fm, BM_ELEM_HIDDEN)) {
                        int cont = 1;
                        for (idx = 0; idx < num_sels && cont == 1; idx++) {
                                fs = f_ext[indices[idx]].f;
@@ -767,7 +767,7 @@ void bmesh_similaredges_exec(BMesh *bm, BMOperator *op)
        /* select the edges if any */
        for (i = 0; i < num_total; i++) {
                e = e_ext[i].e;
-               if (!BMO_TestFlag(bm, e, EDGE_MARK) && !BM_TestHFlag(e, BM_HIDDEN)) {
+               if (!BMO_TestFlag(bm, e, EDGE_MARK) && !BM_TestHFlag(e, BM_ELEM_HIDDEN)) {
                        int cont = 1;
                        for (idx = 0; idx < num_sels && cont == 1; idx++) {
                                es = e_ext[indices[idx]].e;
@@ -828,14 +828,14 @@ void bmesh_similaredges_exec(BMesh *bm, BMOperator *op)
                                                break;
 
                                        case SIMEDGE_SEAM:
-                                               if (BM_TestHFlag(e, BM_SEAM) == BM_TestHFlag(es, BM_SEAM)) {
+                                               if (BM_TestHFlag(e, BM_ELEM_SEAM) == BM_TestHFlag(es, BM_ELEM_SEAM)) {
                                                        BMO_SetFlag(bm, e, EDGE_MARK);
                                                        cont = 0;
                                                }
                                                break;
 
                                        case SIMEDGE_SHARP:
-                                               if (BM_TestHFlag(e, BM_SHARP) == BM_TestHFlag(es, BM_SHARP)) {
+                                               if (BM_TestHFlag(e, BM_ELEM_SHARP) == BM_TestHFlag(es, BM_ELEM_SHARP)) {
                                                        BMO_SetFlag(bm, e, EDGE_MARK);
                                                        cont = 0;
                                                }
@@ -923,7 +923,7 @@ void bmesh_similarverts_exec(BMesh *bm, BMOperator *op)
        /* select the vertices if any */
        for (i = 0; i < num_total; i++) {
                v = v_ext[i].v;
-               if (!BMO_TestFlag(bm, v, VERT_MARK) && !BM_TestHFlag(v, BM_HIDDEN)) {
+               if (!BMO_TestFlag(bm, v, VERT_MARK) && !BM_TestHFlag(v, BM_ELEM_HIDDEN)) {
                        int cont = 1;
                        for (idx = 0; idx < num_sels && cont == 1; idx++) {
                                vs = v_ext[indices[idx]].v;
index 54e7bca220e8c9345b1853626cfb4fec952abad8..2b7537e12e7df07703cbc247e911e62c934ae5a8 100644 (file)
@@ -773,7 +773,7 @@ static void bevel_init_verts(BMesh *bm, int options, BME_TransData_Head *td)
                if (!BMO_TestFlag(bm, v, BME_BEVEL_NONMAN)) {
                        /* modifiers should not use selection */
                        if(options & BME_BEVEL_SELECT){
-                               if(BM_TestHFlag(v, BM_SELECT)) weight = 1.0;
+                               if(BM_TestHFlag(v, BM_ELEM_SELECT)) weight = 1.0;
                        }
                        /* bevel weight NYI */
                        else if(options & BME_BEVEL_WEIGHT)
@@ -798,7 +798,7 @@ static void bevel_init_edges(BMesh *bm, int options, BME_TransData_Head *td)
                weight = 0.0;
                if (!BMO_TestFlag(bm, e, BME_BEVEL_NONMAN)) {
                        if(options & BME_BEVEL_SELECT){
-                               if(BM_TestHFlag(e, BM_SELECT)) weight = 1.0;
+                               if(BM_TestHFlag(e, BM_ELEM_SELECT)) weight = 1.0;
                        }
                        else if(options & BME_BEVEL_WEIGHT) {
                                weight = BM_GetCDf(&bm->edata, e, CD_BWEIGHT);
index a75cece5248d4e434dc4166b7638e25e48cde01a..948eb55b55f6811a0a962d07f367738fcb6c7d63 100644 (file)
@@ -71,25 +71,25 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
        BMIter iter;
 
        BM_ITER(v1, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (!BM_TestHFlag(v1, BM_SELECT) || BM_TestHFlag(v1, BM_HIDDEN)) {
-                       BM_ClearHFlag(v1, BM_TMP_TAG);
+               if (!BM_TestHFlag(v1, BM_ELEM_SELECT) || BM_TestHFlag(v1, BM_ELEM_HIDDEN)) {
+                       BM_ClearHFlag(v1, BM_ELEM_TAG);
                }
                else {
-                       BM_SetHFlag(v1, BM_TMP_TAG);
+                       BM_SetHFlag(v1, BM_ELEM_TAG);
                }
        }
 
        EDBM_CacheMirrorVerts(em, TRUE);
 
        if (!extend)
-               EDBM_clear_flag_all(em, BM_SELECT);
+               EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        BM_ITER(v1, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (!BM_TestHFlag(v1, BM_TMP_TAG) || BM_TestHFlag(v1, BM_HIDDEN))
+               if (!BM_TestHFlag(v1, BM_ELEM_TAG) || BM_TestHFlag(v1, BM_ELEM_HIDDEN))
                        continue;
 
                v2 = EDBM_GetMirrorVert(em, v1);
-               if (v2 && !BM_TestHFlag(v2, BM_HIDDEN)) {
+               if (v2 && !BM_TestHFlag(v2, BM_ELEM_HIDDEN)) {
                        BM_Select(em->bm, v2, TRUE);
                }
        }
@@ -108,7 +108,7 @@ void EDBM_automerge(Scene *scene, Object *obedit, int update)
                if (!em)
                        return;
 
-               BMO_CallOpf(em->bm, "automerge verts=%hv dist=%f", BM_SELECT, scene->toolsettings->doublimit);
+               BMO_CallOpf(em->bm, "automerge verts=%hv dist=%f", BM_ELEM_SELECT, scene->toolsettings->doublimit);
                if (update) {
                        DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
                }
@@ -334,7 +334,7 @@ static void findnearestvert__doClosest(void *userData, BMVert *eve, int x, int y
 
        if (data->dist > 3) {
                int temp = abs(data->mval[0] - x) + abs(data->mval[1]- y);
-               if (BM_TestHFlag(eve, BM_SELECT) == data->select) {
+               if (BM_TestHFlag(eve, BM_ELEM_SELECT) == data->select) {
                        if (data->strict == 1)
                                return;
                        else
@@ -357,7 +357,7 @@ static unsigned int findnearestvert__backbufIndextest(void *handle, unsigned int
        BMEditMesh *em = (BMEditMesh *)handle;
        BMVert *eve = BM_Vert_AtIndex(em->bm, index - 1);
 
-       if (eve && BM_TestHFlag(eve, BM_SELECT)) return 0;
+       if (eve && BM_TestHFlag(eve, BM_ELEM_SELECT)) return 0;
        return 1;
 }
 /**
@@ -462,7 +462,7 @@ static void findnearestedge__doClosest(void *userData, BMEdge *eed, int x0, int
                
        distance = dist_to_line_segment_v2(data->mval, v1, v2);
                
-       if (BM_TestHFlag(eed, BM_SELECT)) {
+       if (BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                distance += 5;
        }
 
@@ -643,7 +643,7 @@ static int unified_findnearest(ViewContext *vc, BMVert **eve, BMEdge **eed, BMFa
        view3d_validate_backbuf(vc);
        
        if (em->selectmode & SCE_SELECT_VERTEX)
-               *eve = EDBM_findnearestvert(vc, &dist, BM_SELECT, 0);
+               *eve = EDBM_findnearestvert(vc, &dist, BM_ELEM_SELECT, 0);
        if (em->selectmode & SCE_SELECT_FACE)
                *efa = EDBM_findnearestface(vc, &dist);
 
@@ -701,16 +701,16 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
        float thresh = CTX_data_tool_settings(C)->select_thresh;
 
        /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
-       EDBM_InitOpf(em, &bmop, op, "similarfaces faces=%hf type=%d thresh=%f", BM_SELECT, type, thresh);
+       EDBM_InitOpf(em, &bmop, op, "similarfaces faces=%hf type=%d thresh=%f", BM_ELEM_SELECT, type, thresh);
 
        /* execute the operator */
        BMO_Exec_Op(em->bm, &bmop);
 
        /* clear the existing selection */
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        /* select the output */
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "faceout", BM_SELECT, BM_ALL);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "faceout", BM_ELEM_SELECT, BM_ALL);
 
        /* finish the operator */
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
@@ -742,16 +742,16 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
        float thresh = CTX_data_tool_settings(C)->select_thresh;
 
        /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
-       EDBM_InitOpf(em, &bmop, op, "similaredges edges=%he type=%d thresh=%f", BM_SELECT, type, thresh);
+       EDBM_InitOpf(em, &bmop, op, "similaredges edges=%he type=%d thresh=%f", BM_ELEM_SELECT, type, thresh);
 
        /* execute the operator */
        BMO_Exec_Op(em->bm, &bmop);
 
        /* clear the existing selection */
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        /* select the output */
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "edgeout", BM_SELECT, BM_ALL);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_ALL);
        EDBM_selectmode_flush(em);
 
        /* finish the operator */
@@ -787,16 +787,16 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
        float thresh = CTX_data_tool_settings(C)->select_thresh;
 
        /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
-       EDBM_InitOpf(em, &bmop, op, "similarverts verts=%hv type=%d thresh=%f", BM_SELECT, type, thresh);
+       EDBM_InitOpf(em, &bmop, op, "similarverts verts=%hv type=%d thresh=%f", BM_ELEM_SELECT, type, thresh);
 
        /* execute the operator */
        BMO_Exec_Op(em->bm, &bmop);
 
        /* clear the existing selection */
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        /* select the output */
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "vertout", BM_SELECT, BM_ALL);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_ALL);
 
        /* finish the operator */
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
@@ -920,7 +920,7 @@ static int loop_multiselect(bContext *C, wmOperator *op)
        for (eed = BMIter_New(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
            eed; eed = BMIter_Step(&iter)) {
 
-               if (BM_TestHFlag(eed, BM_SELECT)) {
+               if (BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                        totedgesel++;
                }
        }
@@ -934,7 +934,7 @@ static int loop_multiselect(bContext *C, wmOperator *op)
             eed = BMIter_Step(&iter))
        {
 
-               if (BM_TestHFlag(eed, BM_SELECT)) {
+               if (BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                        edarray[edindex] = eed;
                        edindex++;
                }
@@ -1005,10 +1005,10 @@ static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short ring)
        eed = EDBM_findnearestedge(&vc, &dist);
        if (eed) {
                if (extend == 0) {
-                       EDBM_clear_flag_all(em, BM_SELECT);
+                       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
                }
        
-               if (BM_TestHFlag(eed, BM_SELECT) == 0) {
+               if (BM_TestHFlag(eed, BM_ELEM_SELECT) == 0) {
                        select = TRUE;
                }
                else if (extend) {
@@ -1162,12 +1162,12 @@ static void edgetag_context_set(BMEditMesh *em, Scene *scene, BMEdge *e, int val
                BM_Select(em->bm, e, val);
                break;
        case EDGE_MODE_TAG_SEAM:
-               if (val)                {BM_SetHFlag(e, BM_SEAM);}
-               else                    {BM_ClearHFlag(e, BM_SEAM);}
+               if (val)                {BM_SetHFlag(e, BM_ELEM_SEAM);}
+               else                    {BM_ClearHFlag(e, BM_ELEM_SEAM);}
                break;
        case EDGE_MODE_TAG_SHARP:
-               if (val)                {BM_SetHFlag(e, BM_SEAM);}
-               else                    {BM_ClearHFlag(e, BM_SEAM);}
+               if (val)                {BM_SetHFlag(e, BM_ELEM_SEAM);}
+               else                    {BM_ClearHFlag(e, BM_ELEM_SEAM);}
                break;
        case EDGE_MODE_TAG_CREASE:
         {
@@ -1192,11 +1192,11 @@ static int edgetag_context_check(Scene *scene, BMEditMesh *em, BMEdge *e)
 {
        switch (scene->toolsettings->edge_mode) {
        case EDGE_MODE_SELECT:
-               return BM_TestHFlag(e, BM_SELECT) ? 1 : 0;
+               return BM_TestHFlag(e, BM_ELEM_SELECT) ? 1 : 0;
        case EDGE_MODE_TAG_SEAM:
-               return BM_TestHFlag(e, BM_SEAM);
+               return BM_TestHFlag(e, BM_ELEM_SEAM);
        case EDGE_MODE_TAG_SHARP:
-               return BM_TestHFlag(e, BM_SHARP);
+               return BM_TestHFlag(e, BM_ELEM_SHARP);
        case EDGE_MODE_TAG_CREASE:      
                return BM_GetCDf(&em->bm->edata, e, CD_CREASE) ? 1 : 0;
        case EDGE_MODE_TAG_BEVEL:
@@ -1222,7 +1222,7 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
 
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                e->head.flags[0].f = 0;
-               if (BM_TestHFlag(e, BM_HIDDEN)) {
+               if (BM_TestHFlag(e, BM_ELEM_HIDDEN)) {
                        BLI_smallhash_insert(&visithash, (uintptr_t)e, NULL);
                }
 
@@ -1461,13 +1461,13 @@ int mouse_mesh(bContext *C, const int mval[2], short extend)
        
        if (unified_findnearest(&vc, &eve, &eed, &efa)) {
                
-               if (extend == 0) EDBM_clear_flag_all(vc.em, BM_SELECT);
+               if (extend == 0) EDBM_clear_flag_all(vc.em, BM_ELEM_SELECT);
                
                if (efa) {
                        /* set the last selected face */
                        BM_set_actFace(vc.em->bm, efa);
                        
-                       if (!BM_TestHFlag(efa, BM_SELECT)) {
+                       if (!BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                EDBM_store_selection(vc.em, efa);
                                BM_Select(vc.em->bm, efa, TRUE);
                        }
@@ -1477,7 +1477,7 @@ int mouse_mesh(bContext *C, const int mval[2], short extend)
                        }
                }
                else if (eed) {
-                       if (!BM_TestHFlag(eed, BM_SELECT)) {
+                       if (!BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                EDBM_store_selection(vc.em, eed);
                                BM_Select(vc.em->bm, eed, TRUE);
                        }
@@ -1487,7 +1487,7 @@ int mouse_mesh(bContext *C, const int mval[2], short extend)
                        }
                }
                else if (eve) {
-                       if (!BM_TestHFlag(eve, BM_SELECT)) {
+                       if (!BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                EDBM_store_selection(vc.em, eve);
                                BM_Select(vc.em->bm, eve, TRUE);
                        }
@@ -1567,7 +1567,7 @@ void EDBM_selectmode_set(BMEditMesh *em)
                
                eed = BMIter_New(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
                for ( ; eed; eed = BMIter_Step(&iter)) {
-                       if (BM_TestHFlag(eed, BM_SELECT)) {
+                       if (BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                BM_Select(em->bm, eed, TRUE);
                        }
                }
@@ -1582,7 +1582,7 @@ void EDBM_selectmode_set(BMEditMesh *em)
                
                efa = BMIter_New(&iter, em->bm, BM_FACES_OF_MESH, NULL);
                for ( ; efa; efa = BMIter_Step(&iter)) {
-                       if (BM_TestHFlag(efa, BM_SELECT)) {
+                       if (BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                BM_Select(em->bm, efa, TRUE);
                        }
                }
@@ -1601,8 +1601,8 @@ void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
                        /* select all edges associated with every selected vertex */
                        eed = BMIter_New(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
                        for ( ; eed; eed = BMIter_Step(&iter)) {
-                               if ( (BM_TestHFlag(eed->v1, BM_SELECT) ||
-                                     BM_TestHFlag(eed->v2, BM_SELECT)))
+                               if ( (BM_TestHFlag(eed->v1, BM_ELEM_SELECT) ||
+                                     BM_TestHFlag(eed->v2, BM_ELEM_SELECT)))
                                {
                                        BM_Select(em->bm, eed, TRUE);
                                }
@@ -1617,7 +1617,7 @@ void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
                        for ( ; efa; efa = BMIter_Step(&iter)) {
                                l = BMIter_New(&liter, em->bm, BM_LOOPS_OF_FACE, efa);
                                for (; l; l = BMIter_Step(&liter)) {
-                                       if (BM_TestHFlag(l->v, BM_SELECT)) {
+                                       if (BM_TestHFlag(l->v, BM_ELEM_SELECT)) {
                                                BM_Select(em->bm, efa, TRUE);
                                                break;
                                        }
@@ -1636,7 +1636,7 @@ void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
                        for ( ; efa; efa = BMIter_Step(&iter)) {
                                l = BMIter_New(&liter, em->bm, BM_LOOPS_OF_FACE, efa);
                                for (; l; l = BMIter_Step(&liter)) {
-                                       if (BM_TestHFlag(l->v, BM_SELECT)) {
+                                       if (BM_TestHFlag(l->v, BM_ELEM_SELECT)) {
                                                BM_Select(em->bm, efa, TRUE);
                                                break;
                                        }
@@ -1653,7 +1653,7 @@ void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const s
        BMFace *efa;
 
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (BM_TestHFlag(efa, BM_HIDDEN))
+               if (BM_TestHFlag(efa, BM_ELEM_HIDDEN))
                        continue;
                if (efa->mat_nr == index) {
                        BM_Select(em->bm, efa, select);
@@ -1671,23 +1671,23 @@ void EDBM_select_swap(BMEditMesh *em) /* exported for UV */
        
        if (em->bm->selectmode & SCE_SELECT_VERTEX) {
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(eve, BM_HIDDEN))
+                       if (BM_TestHFlag(eve, BM_ELEM_HIDDEN))
                                continue;
-                       BM_Select(em->bm, eve, !BM_TestHFlag(eve, BM_SELECT));
+                       BM_Select(em->bm, eve, !BM_TestHFlag(eve, BM_ELEM_SELECT));
                }
        }
        else if (em->selectmode & SCE_SELECT_EDGE) {
                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(eed, BM_HIDDEN))
+                       if (BM_TestHFlag(eed, BM_ELEM_HIDDEN))
                                continue;
-                       BM_Select(em->bm, eed, !BM_TestHFlag(eed, BM_SELECT));
+                       BM_Select(em->bm, eed, !BM_TestHFlag(eed, BM_ELEM_SELECT));
                }
        }
        else {
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(efa, BM_HIDDEN))
+                       if (BM_TestHFlag(efa, BM_ELEM_HIDDEN))
                                continue;
-                       BM_Select(em->bm, efa, !BM_TestHFlag(efa, BM_SELECT));
+                       BM_Select(em->bm, efa, !BM_TestHFlag(efa, BM_ELEM_SELECT));
                }
 
        }
@@ -1755,14 +1755,14 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
 
                if (limit) {
                        BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                               if (!BM_TestHFlag(e, BM_SEAM)) BMO_SetFlag(bm, e, BM_SELECT);
-                               else                           BMO_ClearFlag(bm, e, BM_SELECT); /* is this needed ? */
+                               if (!BM_TestHFlag(e, BM_ELEM_SEAM)) BMO_SetFlag(bm, e, BM_ELEM_SELECT);
+                               else                           BMO_ClearFlag(bm, e, BM_ELEM_SELECT); /* is this needed ? */
                        }
                }
 
                /* walk */
                BMW_Init(&walker, bm, BMW_ISLAND,
-                        BMW_MASK_NOP, limit ? BM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+                        BMW_MASK_NOP, limit ? BM_ELEM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
                         BMW_NIL_LAY);
 
                e = BMW_Begin(&walker, efa);
@@ -1836,27 +1836,27 @@ static int select_linked_exec(bContext *C, wmOperator *op)
                BMFace *efa;
 
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(efa, BM_SELECT) && !BM_TestHFlag(efa, BM_HIDDEN)) {
-                               BM_SetHFlag(efa, BM_TMP_TAG);
+                       if (BM_TestHFlag(efa, BM_ELEM_SELECT) && !BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
+                               BM_SetHFlag(efa, BM_ELEM_TAG);
                        }
                        else {
-                               BM_ClearHFlag(efa, BM_TMP_TAG);
+                               BM_ClearHFlag(efa, BM_ELEM_TAG);
                        }
                }
 
                if (limit) {
                        BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                               if (!BM_TestHFlag(e, BM_SEAM)) BMO_SetFlag(bm, e, BM_SELECT);
-                               else                           BMO_ClearFlag(bm, e, BM_SELECT); /* is this needed ? */
+                               if (!BM_TestHFlag(e, BM_ELEM_SEAM)) BMO_SetFlag(bm, e, BM_ELEM_SELECT);
+                               else                           BMO_ClearFlag(bm, e, BM_ELEM_SELECT); /* is this needed ? */
                        }
                }
 
                BMW_Init(&walker, bm, BMW_ISLAND,
-                        BMW_MASK_NOP, limit ? BM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+                        BMW_MASK_NOP, limit ? BM_ELEM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
                         BMW_NIL_LAY);
 
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(efa, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(efa, BM_ELEM_TAG)) {
                                e = BMW_Begin(&walker, efa);
                                for (; efa; efa = BMW_Step(&walker)) {
                                        BM_Select(bm, efa, TRUE);
@@ -1867,11 +1867,11 @@ static int select_linked_exec(bContext *C, wmOperator *op)
        }
        else  {
                BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(v, BM_SELECT) && !BM_TestHFlag(v, BM_HIDDEN)) {
-                               BM_SetHFlag(v, BM_TMP_TAG);
+                       if (BM_TestHFlag(v, BM_ELEM_SELECT) && !BM_TestHFlag(v, BM_ELEM_HIDDEN)) {
+                               BM_SetHFlag(v, BM_ELEM_TAG);
                        }
                        else {
-                               BM_ClearHFlag(v, BM_TMP_TAG);
+                               BM_ClearHFlag(v, BM_ELEM_TAG);
                        }
                }
 
@@ -1879,7 +1879,7 @@ static int select_linked_exec(bContext *C, wmOperator *op)
                         BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
                         BMW_NIL_LAY);
                BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(v, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(v, BM_ELEM_TAG)) {
                                e = BMW_Begin(&walker, v);
                                for (; e; e = BMW_Step(&walker)) {
                                        BM_Select(em->bm, e->v1, TRUE);
@@ -1991,28 +1991,28 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
                itertype = BM_VERTS_OF_MESH;
                walktype = BMW_CONNECTED_VERTEX;
                flushtype = SCE_SELECT_VERTEX;
-               mask_vert = BM_SELECT;
+               mask_vert = BM_ELEM_SELECT;
                break;
        case BM_EDGE:
                itertype = BM_EDGES_OF_MESH;
                walktype = BMW_SHELL;
                flushtype = SCE_SELECT_EDGE;
-               mask_edge = BM_SELECT;
+               mask_edge = BM_ELEM_SELECT;
                break;
        case BM_FACE:
                itertype = BM_FACES_OF_MESH;
                walktype = BMW_ISLAND;
                flushtype = SCE_SELECT_FACE;
-               mask_face = BM_SELECT;
+               mask_face = BM_ELEM_SELECT;
                break;
        }
 
        /* Walker restrictions uses BMO flags, not header flags,
-        * so transfer BM_SELECT from HFlags onto a BMO flag layer. */
+        * so transfer BM_ELEM_SELECT from HFlags onto a BMO flag layer. */
        BMO_push(bm, NULL);
        BM_ITER(h, &iter, bm, itertype, NULL) {
-               if (BM_TestHFlag(h, BM_SELECT)) {
-                       BMO_SetFlag(bm, h, BM_SELECT);
+               if (BM_TestHFlag(h, BM_ELEM_SELECT)) {
+                       BMO_SetFlag(bm, h, BM_ELEM_SELECT);
                }
        }
 
@@ -2067,7 +2067,7 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **v_p, BMEdge **e_p, BMFa
 
        if (em->selectmode & SCE_SELECT_VERTEX) {
                BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(v, BM_SELECT)) {
+                       if (BM_TestHFlag(v, BM_ELEM_SELECT)) {
                                *v_p = v;
                                return;
                        }
@@ -2075,7 +2075,7 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **v_p, BMEdge **e_p, BMFa
        }
        else if (em->selectmode & SCE_SELECT_EDGE) {
                BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(e, BM_SELECT)) {
+                       if (BM_TestHFlag(e, BM_ELEM_SELECT)) {
                                *e_p = e;
                                return;
                        }
@@ -2188,7 +2188,7 @@ static int select_sharp_edges_exec(bContext *C, wmOperator *op)
        sharp = DEG2RADF(sharp);
 
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_HIDDEN) || !e->l)
+               if (BM_TestHFlag(e, BM_ELEM_HIDDEN) || !e->l)
                        continue;
 
                l1 = e->l;
@@ -2243,11 +2243,11 @@ static int select_linked_flat_faces_exec(bContext *C, wmOperator *op)
        sharp = (sharp * M_PI) / 180.0;
 
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               BM_ClearHFlag(f, BM_TMP_TAG);
+               BM_ClearHFlag(f, BM_ELEM_TAG);
        }
 
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (BM_TestHFlag(f, BM_HIDDEN) || !BM_TestHFlag(f, BM_SELECT) || BM_TestHFlag(f, BM_TMP_TAG))
+               if (BM_TestHFlag(f, BM_ELEM_HIDDEN) || !BM_TestHFlag(f, BM_ELEM_SELECT) || BM_TestHFlag(f, BM_ELEM_TAG))
                        continue;
 
                BLI_array_empty(stack);
@@ -2262,13 +2262,13 @@ static int select_linked_flat_faces_exec(bContext *C, wmOperator *op)
 
                        BM_Select(em->bm, f, TRUE);
 
-                       BM_SetHFlag(f, BM_TMP_TAG);
+                       BM_SetHFlag(f, BM_ELEM_TAG);
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) {
                                BM_ITER(l2, &liter2, em->bm, BM_LOOPS_OF_LOOP, l) {
                                        float angle;
 
-                                       if (BM_TestHFlag(l2->f, BM_TMP_TAG) || BM_TestHFlag(l2->f, BM_HIDDEN))
+                                       if (BM_TestHFlag(l2->f, BM_ELEM_TAG) || BM_TestHFlag(l2->f, BM_ELEM_HIDDEN))
                                                continue;
 
                                        /* edge has exactly two neighboring faces, check angle */
@@ -2328,13 +2328,13 @@ static int select_non_manifold_exec(bContext *C, wmOperator *op)
        }
        
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (!BM_TestHFlag(em->bm, BM_HIDDEN) && BM_Nonmanifold_Vert(em->bm, v)) {
+               if (!BM_TestHFlag(em->bm, BM_ELEM_HIDDEN) && BM_Nonmanifold_Vert(em->bm, v)) {
                        BM_Select(em->bm, v, TRUE);
                }
        }
        
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (!BM_TestHFlag(em->bm, BM_HIDDEN) && BM_Edge_FaceCount(e) != 2) {
+               if (!BM_TestHFlag(em->bm, BM_ELEM_HIDDEN) && BM_Edge_FaceCount(e) != 2) {
                        BM_Select(em->bm, e, TRUE);
                }
        }
@@ -2372,11 +2372,11 @@ static int mesh_select_random_exec(bContext *C, wmOperator *op)
        BLI_srand(BLI_rand()); /* random seed */
        
        if (!RNA_boolean_get(op->ptr, "extend"))
-               EDBM_clear_flag_all(em, BM_SELECT);
+               EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        if (em->selectmode & SCE_SELECT_VERTEX) {
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(eve, BM_HIDDEN) && BLI_frand() < randfac) {
+                       if (!BM_TestHFlag(eve, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
                                BM_Select(em->bm, eve, TRUE);
                        }
                }
@@ -2384,7 +2384,7 @@ static int mesh_select_random_exec(bContext *C, wmOperator *op)
        }
        else if (em->selectmode & SCE_SELECT_EDGE) {
                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(eed, BM_HIDDEN) && BLI_frand() < randfac) {
+                       if (!BM_TestHFlag(eed, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
                                BM_Select(em->bm, eed, TRUE);
                        }
                }
@@ -2392,7 +2392,7 @@ static int mesh_select_random_exec(bContext *C, wmOperator *op)
        }
        else {
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_HIDDEN) && BLI_frand() < randfac) {
+                       if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
                                BM_Select(em->bm, efa, TRUE);
                        }
                }
@@ -2434,7 +2434,7 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
        BMIter iter;
        
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BM_ClearHFlag(v, BM_TMP_TAG);
+               BM_ClearHFlag(v, BM_ELEM_TAG);
        }
        
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -2442,15 +2442,15 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
                BMIter liter;
                
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) {
-                       if (BM_TestHFlag(l->v, BM_SELECT) && !BM_TestHFlag(l->v, BM_HIDDEN)) {
-                               BM_SetHFlag(l->next->v, BM_TMP_TAG);
+                       if (BM_TestHFlag(l->v, BM_ELEM_SELECT) && !BM_TestHFlag(l->v, BM_ELEM_HIDDEN)) {
+                               BM_SetHFlag(l->next->v, BM_ELEM_TAG);
                                BM_Select(em->bm, l->v, FALSE);
                        }
                }
        }
 
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_TMP_TAG)) {
+               if (BM_TestHFlag(v, BM_ELEM_TAG)) {
                        BM_Select(em->bm, v, TRUE);
                }
        }
@@ -2487,7 +2487,7 @@ static int region_to_loop(bContext *C, wmOperator *UNUSED(op))
        em_setup_viewcontext(C, &vc);
        
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               BM_ClearHFlag(e, BM_TMP_TAG);
+               BM_ClearHFlag(e, BM_ELEM_TAG);
        }
 
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -2499,18 +2499,18 @@ static int region_to_loop(bContext *C, wmOperator *UNUSED(op))
                        
                        BM_ITER(l2, &liter2, em->bm, BM_LOOPS_OF_EDGE, l1->e) {
                                tot++;
-                               totsel += BM_TestHFlag(l2->f, BM_SELECT) != 0;
+                               totsel += BM_TestHFlag(l2->f, BM_ELEM_SELECT) != 0;
                        }
                        
                        if ((tot != totsel && totsel > 0) || (totsel == 1 && tot == 1))
-                               BM_SetHFlag(l1->e, BM_TMP_TAG);
+                               BM_SetHFlag(l1->e, BM_ELEM_TAG);
                }
        }
 
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
        
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_TMP_TAG) && !BM_TestHFlag(e, BM_HIDDEN))
+               if (BM_TestHFlag(e, BM_ELEM_TAG) && !BM_TestHFlag(e, BM_ELEM_HIDDEN))
                        BM_Select_Edge(em->bm, e, TRUE);
        }
 
@@ -2607,16 +2607,16 @@ static int loop_find_regions(BMEditMesh *em, int selbigger)
        BLI_smallhash_init(&visithash);
        
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               BM_ClearHFlag(f, BM_TMP_TAG);
+               BM_ClearHFlag(f, BM_ELEM_TAG);
        }
 
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_SELECT)) {
+               if (BM_TestHFlag(e, BM_ELEM_SELECT)) {
                        BLI_array_append(edges, e);
-                       BM_SetHFlag(e, BM_TMP_TAG);
+                       BM_SetHFlag(e, BM_ELEM_TAG);
                }
                else {
-                       BM_ClearHFlag(e, BM_TMP_TAG);
+                       BM_ClearHFlag(e, BM_ELEM_TAG);
                }
        }
        
@@ -2631,14 +2631,14 @@ static int loop_find_regions(BMEditMesh *em, int selbigger)
                
                e = edges[i];
                
-               if (!BM_TestHFlag(e, BM_TMP_TAG))
+               if (!BM_TestHFlag(e, BM_ELEM_TAG))
                        continue;
                
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_EDGE, e) {
                        if (BLI_smallhash_haskey(&visithash, (uintptr_t)l->f))
                                continue;
                                                
-                       c = loop_find_region(em, l, BM_SELECT, &visithash, &r);
+                       c = loop_find_region(em, l, BM_ELEM_SELECT, &visithash, &r);
 
                        if (!region || (selbigger ? c >= tot : c < tot)) {
                                /* this region is the best seen so far */
@@ -2660,9 +2660,9 @@ static int loop_find_regions(BMEditMesh *em, int selbigger)
                        int j;
                        
                        for (j = 0; j < tot; j++) {
-                               BM_SetHFlag(region[j], BM_TMP_TAG);
+                               BM_SetHFlag(region[j], BM_ELEM_TAG);
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, region[j]) {
-                                       BM_ClearHFlag(l->e, BM_TMP_TAG);
+                                       BM_ClearHFlag(l->e, BM_ELEM_TAG);
                                }
                        }
                        
@@ -2695,10 +2695,10 @@ static int loop_to_region(bContext *C, wmOperator *op)
                loop_find_regions(em, selbigger);
        }
        
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
        
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (BM_TestHFlag(f, BM_TMP_TAG) && !BM_TestHFlag(f, BM_HIDDEN)) {
+               if (BM_TestHFlag(f, BM_ELEM_TAG) && !BM_TestHFlag(f, BM_ELEM_HIDDEN)) {
                        BM_Select_Face(em->bm, f, TRUE);
                }
        }
index bea82e1a15f3164e941e783702c31f81e28a1644..2d274526110649ab5d84cf680499106ff444f1ed 100644 (file)
@@ -94,7 +94,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
                RNA_enum_set(op->ptr, "quadcorner", SUBD_INNERVERT);
        }
        
-       BM_esubdivideflag(obedit, em->bm, BM_SELECT, 
+       BM_esubdivideflag(obedit, em->bm, BM_ELEM_SELECT, 
                          smooth, fractal,
                          ts->editbutflag|flag, 
                          cuts, 0, RNA_enum_get(op->ptr, "quadcorner"), 
@@ -150,7 +150,7 @@ void EMBM_project_snap_verts(bContext *C, ARegion *ar, Object *obedit, BMEditMes
        BMVert *eve;
 
        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(eve, BM_SELECT)) {
+               if (BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                        float mval[2], vec[3], no_dummy[3];
                        int dist_dummy;
                        mul_v3_m4v3(vec, obedit->obmat, eve->co);
@@ -176,7 +176,7 @@ static short EDBM_Extrude_face_indiv(BMEditMesh *em, wmOperator *op, const char
        EDBM_InitOpf(em, &bmop, op, "extrude_face_indiv faces=%hf", hflag);
 
        /* deselect original verts */
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        BMO_Exec_Op(em->bm, &bmop);
        
@@ -204,10 +204,10 @@ static short EDBM_Extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char
        EDBM_InitOpf(em, &bmop, op, "extrude_edge_only edges=%he", hflag);
 
        /* deselect original verts */
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        BMO_Exec_Op(em->bm, &bmop);
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_SELECT, BM_VERT|BM_EDGE);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_VERT|BM_EDGE);
 
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
                return 0;
@@ -224,10 +224,10 @@ static short EDBM_Extrude_verts_indiv(BMEditMesh *em, wmOperator *op, const char
        EDBM_InitOpf(em, &bmop, op, "extrude_vert_indiv verts=%hv", hflag);
 
        /* deselect original verts */
-       BMO_UnHeaderFlag_Buffer(em->bm, &bmop, "verts", BM_SELECT, BM_VERT);
+       BMO_UnHeaderFlag_Buffer(em->bm, &bmop, "verts", BM_ELEM_SELECT, BM_VERT);
 
        BMO_Exec_Op(em->bm, &bmop);
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "vertout", BM_SELECT, BM_VERT);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_VERT);
 
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
                return 0;
@@ -309,7 +309,7 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
                }
        }
 
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        BMO_Exec_Op(bm, &extop);
 
@@ -341,21 +341,21 @@ static short EDBM_Extrude_vert(Object *obedit, BMEditMesh *em, const char hflag,
        eed = BMIter_New(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
        for ( ; eed; eed = BMIter_Step(&iter)) {
                if (BM_TestHFlag(eed, hflag)) {
-                       if (hflag & BM_SELECT) {
+                       if (hflag & BM_ELEM_SELECT) {
                                BM_Select(em->bm, eed->v1, TRUE);
                                BM_Select(em->bm, eed->v2, TRUE);
                        }
 
-                       BM_SetHFlag(eed->v1, hflag & ~BM_SELECT);
-                       BM_SetHFlag(eed->v2, hflag & ~BM_SELECT);
+                       BM_SetHFlag(eed->v1, hflag & ~BM_ELEM_SELECT);
+                       BM_SetHFlag(eed->v2, hflag & ~BM_ELEM_SELECT);
                }
                else {
                        if (BM_TestHFlag(eed->v1, hflag) && BM_TestHFlag(eed->v2, hflag)) {
-                               if (hflag & BM_SELECT) {
+                               if (hflag & BM_ELEM_SELECT) {
                                        BM_Select(em->bm, eed, TRUE);
                                }
 
-                               BM_SetHFlag(eed, hflag & ~BM_SELECT);
+                               BM_SetHFlag(eed, hflag & ~BM_ELEM_SELECT);
                        }
                }
        }
@@ -385,9 +385,9 @@ static int extrude_repeat_mesh(bContext *C, wmOperator *op)
        mul_m3_v3(tmat, dvec);
 
        for (a = 0; a < steps; a++) {
-               EDBM_Extrude_edge(obedit, em, BM_SELECT, nor);
-               //BMO_CallOpf(em->bm, "extrudefaceregion edgefacein=%hef", BM_SELECT);
-               BMO_CallOpf(em->bm, "translate vec=%v verts=%hv", (float *)dvec, BM_SELECT);
+               EDBM_Extrude_edge(obedit, em, BM_ELEM_SELECT, nor);
+               //BMO_CallOpf(em->bm, "extrudefaceregion edgefacein=%hef", BM_ELEM_SELECT);
+               BMO_CallOpf(em->bm, "translate vec=%v verts=%hv", (float *)dvec, BM_ELEM_SELECT);
                //extrudeflag(obedit, em, SELECT, nor);
                //translateflag(em, SELECT, dvec);
        }
@@ -461,11 +461,11 @@ static int EDBM_Extrude_Mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
        if (nr < 1) return 'g';
 
        if (nr == 1 && em->selectmode & SCE_SELECT_VERTEX)
-               transmode = EDBM_Extrude_vert(obedit, em, BM_SELECT, nor);
-       else if (nr == 1) transmode = EDBM_Extrude_edge(obedit, em, BM_SELECT, nor);
-       else if (nr == 4) transmode = EDBM_Extrude_verts_indiv(em, op, BM_SELECT, nor);
-       else if (nr == 3) transmode = EDBM_Extrude_edges_indiv(em, op, BM_SELECT, nor);
-       else transmode = EDBM_Extrude_face_indiv(em, op, BM_SELECT, nor);
+               transmode = EDBM_Extrude_vert(obedit, em, BM_ELEM_SELECT, nor);
+       else if (nr == 1) transmode = EDBM_Extrude_edge(obedit, em, BM_ELEM_SELECT, nor);
+       else if (nr == 4) transmode = EDBM_Extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor);
+       else if (nr == 3) transmode = EDBM_Extrude_edges_indiv(em, op, BM_ELEM_SELECT, nor);
+       else transmode = EDBM_Extrude_face_indiv(em, op, BM_ELEM_SELECT, nor);
        
        if (transmode == 0) {
                BKE_report(op->reports, RPT_ERROR, "Not a valid selection for extrude");
@@ -544,7 +544,7 @@ static int mesh_extrude_verts_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
        float nor[3];
 
-       EDBM_Extrude_verts_indiv(em, op, BM_SELECT, nor);
+       EDBM_Extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor);
        
        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
        
@@ -574,7 +574,7 @@ static int mesh_extrude_edges_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
        float nor[3];
 
-       EDBM_Extrude_edges_indiv(em, op, BM_SELECT, nor);
+       EDBM_Extrude_edges_indiv(em, op, BM_ELEM_SELECT, nor);
        
        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
        
@@ -604,7 +604,7 @@ static int mesh_extrude_faces_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
        float nor[3];
 
-       EDBM_Extrude_face_indiv(em, op, BM_SELECT, nor);
+       EDBM_Extrude_face_indiv(em, op, BM_ELEM_SELECT, nor);
        
        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
        
@@ -632,9 +632,9 @@ void MESH_OT_extrude_faces_indiv(wmOperatorType *ot)
 void EDBM_toggle_select_all(BMEditMesh *em) /* exported for UV */
 {
        if (em->bm->totvertsel || em->bm->totedgesel || em->bm->totfacesel)
-               EDBM_clear_flag_all(em, BM_SELECT);
+               EDBM_clear_flag_all(em, BM_ELEM_SELECT);
        else 
-               EDBM_set_flag_all(em, BM_SELECT);
+               EDBM_set_flag_all(em, BM_ELEM_SELECT);
 }
 
 static int mesh_select_all_exec(bContext *C, wmOperator *op)
@@ -648,10 +648,10 @@ static int mesh_select_all_exec(bContext *C, wmOperator *op)
                EDBM_toggle_select_all(em);
                break;
        case SEL_SELECT:
-               EDBM_set_flag_all(em, BM_SELECT);
+               EDBM_set_flag_all(em, BM_ELEM_SELECT);
                break;
        case SEL_DESELECT:
-               EDBM_clear_flag_all(em, BM_SELECT);
+               EDBM_clear_flag_all(em, BM_ELEM_SELECT);
                break;
        case SEL_INVERT:
                EDBM_select_swap(em);
@@ -698,7 +698,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
        INIT_MINMAX(min, max);
        
        BM_ITER(v1, &iter, vc.em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v1, BM_SELECT)) {
+               if (BM_TestHFlag(v1, BM_ELEM_SELECT)) {
                        DO_MINMAX(v1->co, min, max);
                        done = 1;
                }
@@ -720,7 +720,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
                /* check for edges that are half selected, use for rotation */
                done = 0;
                BM_ITER(eed, &iter, vc.em->bm, BM_EDGES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(eed, BM_SELECT)) {
+                       if (BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                float co1[3], co2[3];
                                mul_v3_m4v3(co1, vc.obedit->obmat, eed->v1->co);
                                mul_v3_m4v3(co2, vc.obedit->obmat, eed->v2->co);
@@ -799,18 +799,18 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
                
                if (rot_src) {
                        EDBM_CallOpf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3",
-                               BM_SELECT, cent, mat);
+                               BM_ELEM_SELECT, cent, mat);
 
                        /* also project the source, for retopo workflow */
                        if (use_proj)
                                EMBM_project_snap_verts(C, vc.ar, vc.obedit, vc.em);
                }
 
-               EDBM_Extrude_edge(vc.obedit, vc.em, BM_SELECT, nor);
+               EDBM_Extrude_edge(vc.obedit, vc.em, BM_ELEM_SELECT, nor);
                EDBM_CallOpf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3",
-                       BM_SELECT, cent, mat);
+                       BM_ELEM_SELECT, cent, mat);
                EDBM_CallOpf(vc.em, op, "translate verts=%hv vec=%v",
-                       BM_SELECT, min);
+                       BM_ELEM_SELECT, min);
        }
        else {
                float *curs = give_cursor(vc.scene, vc.v3d);
@@ -876,49 +876,49 @@ static int delete_mesh(bContext *C, Object *obedit, wmOperator *op, int event, S
        if (event == 10) {
                //"Erase Vertices";
 
-               if (!EDBM_CallOpf(bem, op, "del geom=%hv context=%i", BM_SELECT, DEL_VERTS))
+               if (!EDBM_CallOpf(bem, op, "del geom=%hv context=%i", BM_ELEM_SELECT, DEL_VERTS))
                        return OPERATOR_CANCELLED;
        } 
        else if (event == 11) {
                //"Edge Loop"
-               if (!EDBM_CallOpf(bem, op, "dissolveedgeloop edges=%he", BM_SELECT))
+               if (!EDBM_CallOpf(bem, op, "dissolveedgeloop edges=%he", BM_ELEM_SELECT))
                        return OPERATOR_CANCELLED;
        }
        else if (event == 7) {
                int use_verts = RNA_boolean_get(op->ptr, "use_verts");
                //"Dissolve"
                if (bem->selectmode & SCE_SELECT_FACE) {
-                       if (!EDBM_CallOpf(bem, op, "dissolvefaces faces=%hf use_verts=%i", BM_SELECT, use_verts))
+                       if (!EDBM_CallOpf(bem, op, "dissolvefaces faces=%hf use_verts=%i", BM_ELEM_SELECT, use_verts))
                                return OPERATOR_CANCELLED;
                }
                else if (bem->selectmode & SCE_SELECT_EDGE) {
-                       if (!EDBM_CallOpf(bem, op, "dissolveedges edges=%he use_verts=%i", BM_SELECT, use_verts))
+                       if (!EDBM_CallOpf(bem, op, "dissolveedges edges=%he use_verts=%i", BM_ELEM_SELECT, use_verts))
                                return OPERATOR_CANCELLED;
                }
                else if (bem->selectmode & SCE_SELECT_VERTEX) {
-                       if (!EDBM_CallOpf(bem, op, "dissolveverts verts=%hv", BM_SELECT))
+                       if (!EDBM_CallOpf(bem, op, "dissolveverts verts=%hv", BM_ELEM_SELECT))
                                return OPERATOR_CANCELLED;
                }
        }
        else if (event == 4) {
                //Edges and Faces
-               if (!EDBM_CallOpf(bem, op, "del geom=%hef context=%i", BM_SELECT, DEL_EDGESFACES))
+               if (!EDBM_CallOpf(bem, op, "del geom=%hef context=%i", BM_ELEM_SELECT, DEL_EDGESFACES))
                        return OPERATOR_CANCELLED;
        } 
        else if (event == 1) {
                //"Erase Edges"
-               if (!EDBM_CallOpf(bem, op, "del geom=%he context=%i", BM_SELECT, DEL_EDGES))
+               if (!EDBM_CallOpf(bem, op, "del geom=%he context=%i", BM_ELEM_SELECT, DEL_EDGES))
                        return OPERATOR_CANCELLED;
        }
        else if (event == 2) {
                //"Erase Faces";
-               if (!EDBM_CallOpf(bem, op, "del geom=%hf context=%i", BM_SELECT, DEL_FACES))
+               if (!EDBM_CallOpf(bem, op, "del geom=%hf context=%i", BM_ELEM_SELECT, DEL_FACES))
                        return OPERATOR_CANCELLED;
        }
        else if (event == 5) {
                //"Erase Only Faces";
                if (!EDBM_CallOpf(bem, op, "del geom=%hf context=%d",
-                                 BM_SELECT, DEL_ONLYFACES))
+                                 BM_ELEM_SELECT, DEL_ONLYFACES))
                        return OPERATOR_CANCELLED;
        }
        
@@ -951,10 +951,10 @@ static int delete_mesh_exec(bContext *C, wmOperator *op)
        if (type != 12) {
                if (delete_mesh(C, obedit, op, type, scene) == OPERATOR_CANCELLED)
                        return OPERATOR_CANCELLED;
-               EDBM_clear_flag_all(em, BM_SELECT);
+               EDBM_clear_flag_all(em, BM_ELEM_SELECT);
        }
        else {
-               if (!EDBM_CallOpf(em, op, "collapse edges=%he", BM_SELECT))
+               if (!EDBM_CallOpf(em, op, "collapse edges=%he", BM_ELEM_SELECT))
                        return OPERATOR_CANCELLED;
                DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
        }
@@ -995,11 +995,11 @@ static int addedgeface_mesh_exec(bContext *C, wmOperator *op)
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
        
-       if (!EDBM_InitOpf(em, &bmop, op, "contextual_create geom=%hfev", BM_SELECT))
+       if (!EDBM_InitOpf(em, &bmop, op, "contextual_create geom=%hfev", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
        
        BMO_Exec_Op(em->bm, &bmop);
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "faceout", BM_SELECT, BM_FACE);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "faceout", BM_ELEM_SELECT, BM_FACE);
 
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
                return OPERATOR_CANCELLED;
@@ -1045,17 +1045,17 @@ static int editbmesh_mark_seam(bContext *C, wmOperator *op)
 
        if (clear) {
                BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(eed, BM_SELECT) || BM_TestHFlag(eed, BM_HIDDEN))
+                       if (!BM_TestHFlag(eed, BM_ELEM_SELECT) || BM_TestHFlag(eed, BM_ELEM_HIDDEN))
                                continue;
                        
-                       BM_ClearHFlag(eed, BM_SEAM);
+                       BM_ClearHFlag(eed, BM_ELEM_SEAM);
                }
        }
        else {
                BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(eed, BM_SELECT) || BM_TestHFlag(eed, BM_HIDDEN))
+                       if (!BM_TestHFlag(eed, BM_ELEM_SELECT) || BM_TestHFlag(eed, BM_ELEM_HIDDEN))
                                continue;
-                       BM_SetHFlag(eed, BM_SEAM);
+                       BM_SetHFlag(eed, BM_ELEM_SEAM);
                }
        }
 
@@ -1099,18 +1099,18 @@ static int editbmesh_mark_sharp(bContext *C, wmOperator *op)
 
        if (!clear) {
                BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(eed, BM_SELECT) || BM_TestHFlag(eed, BM_HIDDEN))
+                       if (!BM_TestHFlag(eed, BM_ELEM_SELECT) || BM_TestHFlag(eed, BM_ELEM_HIDDEN))
                                continue;
                        
-                       BM_SetHFlag(eed, BM_SHARP);
+                       BM_SetHFlag(eed, BM_ELEM_SHARP);
                }
        }
        else {
                BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(eed, BM_SELECT) || BM_TestHFlag(eed, BM_HIDDEN))
+                       if (!BM_TestHFlag(eed, BM_ELEM_SELECT) || BM_TestHFlag(eed, BM_ELEM_HIDDEN))
                                continue;
                        
-                       BM_ClearHFlag(eed, BM_SHARP);
+                       BM_ClearHFlag(eed, BM_ELEM_SHARP);
                }
        }
 
@@ -1147,7 +1147,7 @@ static int editbmesh_vert_connect(bContext *C, wmOperator *op)
        BMOperator bmop;
        int len = 0;
        
-       if (!EDBM_InitOpf(em, &bmop, op, "connectverts verts=%hv", BM_SELECT)) {
+       if (!EDBM_InitOpf(em, &bmop, op, "connectverts verts=%hv", BM_ELEM_SELECT)) {
                return OPERATOR_CANCELLED;
        }
        BMO_Exec_Op(bm, &bmop);
@@ -1185,7 +1185,7 @@ static int editbmesh_edge_split(bContext *C, wmOperator *op)
        int len = 0;
        
        if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he numcuts=%d", 
-                       BM_SELECT, RNA_int_get(op->ptr,"number_cuts"))) {
+                       BM_ELEM_SELECT, RNA_int_get(op->ptr,"number_cuts"))) {
                return OPERATOR_CANCELLED;
        }
        BMO_Exec_Op(bm, &bmop);
@@ -1224,12 +1224,12 @@ static int mesh_duplicate_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
        BMOperator bmop;
 
-       EDBM_InitOpf(em, &bmop, op, "dupe geom=%hvef", BM_SELECT);
+       EDBM_InitOpf(em, &bmop, op, "dupe geom=%hvef", BM_ELEM_SELECT);
        
        BMO_Exec_Op(em->bm, &bmop);
-       EDBM_clear_flag_all(em, BM_SELECT);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "newout", BM_SELECT, BM_ALL);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "newout", BM_ELEM_SELECT, BM_ALL);
 
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
                return OPERATOR_CANCELLED;
@@ -1272,7 +1272,7 @@ static int flip_normals(bContext *C, wmOperator *op)
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
        
-       if (!EDBM_CallOpf(em, op, "reversefaces faces=%hf", BM_SELECT))
+       if (!EDBM_CallOpf(em, op, "reversefaces faces=%hf", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
        
        DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
@@ -1327,8 +1327,8 @@ static int edge_rotate_selected(bContext *C, wmOperator *op)
        /* first see if we have two adjacent faces */
        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                if (BM_Edge_FaceCount(eed) == 2) {
-                       if ((BM_TestHFlag(eed->l->f, BM_SELECT) && BM_TestHFlag(eed->l->radial_next->f, BM_SELECT))
-                                && !(BM_TestHFlag(eed->l->f, BM_HIDDEN) || BM_TestHFlag(eed->l->radial_next->f, BM_HIDDEN)))
+                       if ((BM_TestHFlag(eed->l->f, BM_ELEM_SELECT) && BM_TestHFlag(eed->l->radial_next->f, BM_ELEM_SELECT))
+                                && !(BM_TestHFlag(eed->l->f, BM_ELEM_HIDDEN) || BM_TestHFlag(eed->l->radial_next->f, BM_ELEM_HIDDEN)))
                        {
                                break;
                        }
@@ -1344,7 +1344,7 @@ static int edge_rotate_selected(bContext *C, wmOperator *op)
 
        if (!eed) {
                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(eed, BM_SELECT) && !BM_TestHFlag(eed, BM_HIDDEN)) {
+                       if (BM_TestHFlag(eed, BM_ELEM_SELECT) && !BM_TestHFlag(eed, BM_ELEM_HIDDEN)) {
                                /* de-select the edge before */
                                do_deselect = TRUE;
                                break;
@@ -1361,10 +1361,10 @@ static int edge_rotate_selected(bContext *C, wmOperator *op)
        /* avoid adding to the selection if we start off with only a selected edge,
         * we could also just deselect the single edge easily but use the BMO api
         * since it seems this is more 'correct' */
-       if (do_deselect) BMO_UnHeaderFlag_Buffer(em->bm, &bmop, "edges", BM_SELECT, BM_EDGE);
+       if (do_deselect) BMO_UnHeaderFlag_Buffer(em->bm, &bmop, "edges", BM_ELEM_SELECT, BM_EDGE);
 
        BMO_Exec_Op(em->bm, &bmop);
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "edgeout", BM_SELECT, BM_EDGE);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_EDGE);
 
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
                return OPERATOR_CANCELLED;
@@ -1411,7 +1411,7 @@ void EDBM_hide_mesh(BMEditMesh *em, int swap)
                itermode = BM_FACES_OF_MESH;
 
        BM_ITER(h, &iter, em->bm, itermode, NULL) {
-               if (BM_TestHFlag(h, BM_SELECT) ^ swap)
+               if (BM_TestHFlag(h, BM_ELEM_SELECT) ^ swap)
                        BM_Hide(em->bm, h, TRUE);
        }
 
@@ -1477,17 +1477,17 @@ void EDBM_reveal_mesh(BMEditMesh *em)
        /* Use index field to remember what was hidden before all is revealed. */
        for (i = 0; i < 3; i++) {
                BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) {
-                       if (BM_TestHFlag(ele, BM_HIDDEN)) {
-                               BM_SetHFlag(ele, BM_TMP_TAG);
+                       if (BM_TestHFlag(ele, BM_ELEM_HIDDEN)) {
+                               BM_SetHFlag(ele, BM_ELEM_TAG);
                        }
                        else {
-                               BM_ClearHFlag(ele, BM_TMP_TAG);
+                               BM_ClearHFlag(ele, BM_ELEM_TAG);
                        }
                }
        }
 
        /* Reveal everything */
-       EDBM_clear_flag_all(em, BM_HIDDEN);
+       EDBM_clear_flag_all(em, BM_ELEM_HIDDEN);
 
        /* Select relevant just-revealed elements */
        for (i = 0; i < 3; i++) {
@@ -1496,7 +1496,7 @@ void EDBM_reveal_mesh(BMEditMesh *em)
                }
 
                BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) {
-                       if (BM_TestHFlag(ele, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(ele, BM_ELEM_TAG)) {
                                BM_Select(em->bm, ele, TRUE);
                        }
                }
@@ -1540,11 +1540,11 @@ static int normals_make_consistent_exec(bContext *C, wmOperator *op)
        
        /* doflip has to do with bmesh_rationalize_normals, it's an internal
         * thing */
-       if (!EDBM_CallOpf(em, op, "righthandfaces faces=%hf doflip=%d", BM_SELECT, 1))
+       if (!EDBM_CallOpf(em, op, "righthandfaces faces=%hf doflip=%d", BM_ELEM_SELECT, 1))
                return OPERATOR_CANCELLED;
 
        if (RNA_boolean_get(op->ptr, "inside"))
-               EDBM_CallOpf(em, op, "reversefaces faces=%hf", BM_SELECT);
+               EDBM_CallOpf(em, op, "reversefaces faces=%hf", BM_ELEM_SELECT);
 
        DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
        WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -1612,7 +1612,7 @@ static int do_smooth_vertex(bContext *C, wmOperator *op)
        for (i = 0; i < repeat; i++) {
                if (!EDBM_CallOpf(em, op,
                                  "vertexsmooth verts=%hv mirror_clip_x=%d mirror_clip_y=%d mirror_clip_z=%d clipdist=%f",
-                                 BM_SELECT, mirrx, mirry, mirrz, clipdist))
+                                 BM_ELEM_SELECT, mirrx, mirry, mirrz, clipdist))
                {
                        return OPERATOR_CANCELLED;
                }
@@ -1620,7 +1620,7 @@ static int do_smooth_vertex(bContext *C, wmOperator *op)
 
        /* apply mirror */
        if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
-               EDBM_ApplyMirrorCache(em, BM_SELECT, 0);
+               EDBM_ApplyMirrorCache(em, BM_ELEM_SELECT, 0);
                EDBM_EndMirrorCache(em);
        }
 
@@ -1660,7 +1660,7 @@ static int bm_test_exec(bContext *C, wmOperator *UNUSED(op))
 
        /* hide all back edges */
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (!BM_TestHFlag(e, BM_SELECT))
+               if (!BM_TestHFlag(e, BM_ELEM_SELECT))
                        continue;
 
                if (!BMBVH_EdgeVisible(tree, e, ar, v3d, obedit))
@@ -1732,11 +1732,11 @@ static void mesh_set_smooth_faces(BMEditMesh *em, short smooth)
        if (em == NULL) return;
        
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (BM_TestHFlag(efa, BM_SELECT)) {
+               if (BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                        if (smooth)
-                               BM_SetHFlag(efa, BM_SMOOTH);
+                               BM_SetHFlag(efa, BM_ELEM_SMOOTH);
                        else
-                               BM_ClearHFlag(efa, BM_SMOOTH);
+                               BM_ClearHFlag(efa, BM_ELEM_SMOOTH);
                }
        }
 }
@@ -1816,7 +1816,7 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op)
        int dir = RNA_enum_get(op->ptr, "direction");
 
        /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
-       EDBM_InitOpf(em, &bmop, op, "meshrotateuvs faces=%hf dir=%d", BM_SELECT, dir);
+       EDBM_InitOpf(em, &bmop, op, "meshrotateuvs faces=%hf dir=%d", BM_ELEM_SELECT, dir);
 
        /* execute the operator */
        BMO_Exec_Op(em->bm, &bmop);
@@ -1841,7 +1841,7 @@ static int mesh_reverse_uvs(bContext *C, wmOperator *op)
        BMOperator bmop;
 
        /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
-       EDBM_InitOpf(em, &bmop, op, "meshreverseuvs faces=%hf", BM_SELECT);
+       EDBM_InitOpf(em, &bmop, op, "meshreverseuvs faces=%hf", BM_ELEM_SELECT);
 
        /* execute the operator */
        BMO_Exec_Op(em->bm, &bmop);
@@ -1869,7 +1869,7 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op)
        int dir = RNA_enum_get(op->ptr, "direction");
 
        /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
-       EDBM_InitOpf(em, &bmop, op, "meshrotatecolors faces=%hf dir=%d", BM_SELECT, dir);
+       EDBM_InitOpf(em, &bmop, op, "meshrotatecolors faces=%hf dir=%d", BM_ELEM_SELECT, dir);
 
        /* execute the operator */
        BMO_Exec_Op(em->bm, &bmop);
@@ -1897,7 +1897,7 @@ static int mesh_reverse_colors(bContext *C, wmOperator *op)
        BMOperator bmop;
 
        /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
-       EDBM_InitOpf(em, &bmop, op, "meshreversecolors faces=%hf", BM_SELECT);
+       EDBM_InitOpf(em, &bmop, op, "meshreversecolors faces=%hf", BM_ELEM_SELECT);
 
        /* execute the operator */
        BMO_Exec_Op(em->bm, &bmop);
@@ -1999,15 +1999,15 @@ static int merge_firstlast(BMEditMesh *em, int first, int uvmerge, wmOperator *w
                mergevert = (BMVert *)ese->data;
        }
 
-       if (!BM_TestHFlag(mergevert, BM_SELECT))
+       if (!BM_TestHFlag(mergevert, BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
        
        if (uvmerge) {
-               if (!EDBM_CallOpf(em, wmop, "pointmerge_facedata verts=%hv snapv=%e", BM_SELECT, mergevert))
+               if (!EDBM_CallOpf(em, wmop, "pointmerge_facedata verts=%hv snapv=%e", BM_ELEM_SELECT, mergevert))
                        return OPERATOR_CANCELLED;
        }
 
-       if (!EDBM_CallOpf(em, wmop, "pointmerge verts=%hv mergeco=%v", BM_SELECT, mergevert->co))
+       if (!EDBM_CallOpf(em, wmop, "pointmerge verts=%hv mergeco=%v", BM_ELEM_SELECT, mergevert->co))
                return OPERATOR_CANCELLED;
 
        return OPERATOR_FINISHED;
@@ -2029,7 +2029,7 @@ static int merge_target(BMEditMesh *em, Scene *scene, View3D *v3d, Object *ob,
                float fac;
                int i = 0;
                BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(v, BM_SELECT))
+                       if (!BM_TestHFlag(v, BM_ELEM_SELECT))
                                continue;
                        add_v3_v3(cent, v->co);
                        i++;
@@ -2048,11 +2048,11 @@ static int merge_target(BMEditMesh *em, Scene *scene, View3D *v3d, Object *ob,
                return OPERATOR_CANCELLED;
        
        if (uvmerge) {
-               if (!EDBM_CallOpf(em, wmop, "vert_average_facedata verts=%hv", BM_SELECT))
+               if (!EDBM_CallOpf(em, wmop, "vert_average_facedata verts=%hv", BM_ELEM_SELECT))
                        return OPERATOR_CANCELLED;
        }
 
-       if (!EDBM_CallOpf(em, wmop, "pointmerge verts=%hv mergeco=%v", BM_SELECT, co))
+       if (!EDBM_CallOpf(em, wmop, "pointmerge verts=%hv mergeco=%v", BM_ELEM_SELECT, co))
                return OPERATOR_CANCELLED;
 
        return OPERATOR_FINISHED;
@@ -2081,7 +2081,7 @@ static int merge_exec(bContext *C, wmOperator *op)
                        break;
                case 5:
                        status = 1;
-                       if (!EDBM_CallOpf(em, op, "collapse edges=%he", BM_SELECT))
+                       if (!EDBM_CallOpf(em, op, "collapse edges=%he", BM_ELEM_SELECT))
                                status = 0;
                        break;
        }
@@ -2174,7 +2174,7 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op)
        /* int count; */ /* UNUSED */
 
        EDBM_InitOpf(em, &bmop, op, "finddoubles verts=%hv dist=%f", 
-               BM_SELECT, RNA_float_get(op->ptr, "mergedist"));
+               BM_ELEM_SELECT, RNA_float_get(op->ptr, "mergedist"));
        BMO_Exec_Op(em->bm, &bmop);
 
        /* count = BMO_CountSlotMap(em->bm, &bmop, "targetmapout"); */ /* UNUSED */
@@ -2265,10 +2265,10 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op)
        BMO_Exec_Op(em->bm, &bmop);
 
        /* DO NOT clear the existing selection */
-       /* EDBM_clear_flag_all(em, BM_SELECT); */
+       /* EDBM_clear_flag_all(em, BM_ELEM_SELECT); */
 
        /* select the output */
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "vertout", BM_SELECT, BM_ALL);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_ALL);
 
        /* finish the operator */
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
@@ -2348,11 +2348,11 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
        ED_view3d_ob_project_mat_get(rv3d, obedit, projectMat);
 
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_SELECT)) {
-                       BM_SetHFlag(e, BM_TMP_TAG);
+               if (BM_TestHFlag(e, BM_ELEM_SELECT)) {
+                       BM_SetHFlag(e, BM_ELEM_TAG);
                }
                else {
-                       BM_ClearHFlag(e, BM_TMP_TAG);
+                       BM_ClearHFlag(e, BM_ELEM_TAG);
                }
        }
 
@@ -2364,7 +2364,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
 
                /* find selected vert */
                BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(v, BM_SELECT))
+                       if (BM_TestHFlag(v, BM_ELEM_SELECT))
                                break;
                }
 
@@ -2403,12 +2403,12 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
                else if (BM_Edge_FaceCount(e2) == 2) {
                        l = e2->l;
                        e = BM_OtherFaceLoop(e2, l->f, v)->e;
-                       BM_SetHFlag(e, BM_TMP_TAG);
+                       BM_SetHFlag(e, BM_ELEM_TAG);
                        BM_Select(bm, e, TRUE);
                        
                        l = e2->l->radial_next;
                        e = BM_OtherFaceLoop(e2, l->f, v)->e;
-                       BM_SetHFlag(e, BM_TMP_TAG);
+                       BM_SetHFlag(e, BM_ELEM_TAG);
                        BM_Select(bm, e, TRUE);
                }
 
@@ -2420,7 +2420,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
                        e2 = NULL;
                        i = 0;
                        BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) {
-                               if (BM_TestHFlag(e, BM_TMP_TAG)) {
+                               if (BM_TestHFlag(e, BM_ELEM_TAG)) {
                                        e2 = e;
                                        i++;
                                }
@@ -2438,7 +2438,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
                }
        }
 
-       if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he", BM_SELECT)) {
+       if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he", BM_ELEM_SELECT)) {
                return OPERATOR_CANCELLED;
        }
        
@@ -2485,15 +2485,15 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
        
        BMBVH_FreeBVH(bvhtree);
 
-       EDBM_clear_flag_all(em, BM_SELECT);
-       BMO_HeaderFlag_Buffer(bm, &bmop, side?"edgeout2":"edgeout1", BM_SELECT, BM_EDGE);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
+       BMO_HeaderFlag_Buffer(bm, &bmop, side?"edgeout2":"edgeout1", BM_ELEM_SELECT, BM_EDGE);
 
        BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_SELECT)) {
-                       BM_SetHFlag(e, BM_TMP_TAG);
+               if (BM_TestHFlag(e, BM_ELEM_SELECT)) {
+                       BM_SetHFlag(e, BM_ELEM_TAG);
                }
                else {
-                       BM_ClearHFlag(e, BM_TMP_TAG);
+                       BM_ClearHFlag(e, BM_ELEM_TAG);
                }
        }
 
@@ -2502,7 +2502,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
                e2 = NULL;
                i = 0;
                BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) {
-                       if (BM_TestHFlag(e, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(e, BM_ELEM_TAG)) {
                                e2 = e;
                                i++;
                        }
@@ -2572,7 +2572,7 @@ static void shape_propagate(Object *obedit, BMEditMesh *em, wmOperator *op)
        }
        
        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (!BM_TestHFlag(eve, BM_SELECT) || BM_TestHFlag(eve, BM_HIDDEN))
+               if (!BM_TestHFlag(eve, BM_ELEM_SELECT) || BM_TestHFlag(eve, BM_ELEM_HIDDEN))
                        continue;
 
                for (i = 0; i < totshape; i++) {
@@ -2644,7 +2644,7 @@ static int blend_from_shape_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
 
        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (!BM_TestHFlag(eve, BM_SELECT) || BM_TestHFlag(eve, BM_HIDDEN))
+               if (!BM_TestHFlag(eve, BM_ELEM_SELECT) || BM_TestHFlag(eve, BM_ELEM_HIDDEN))
                        continue;
 
                sco = CustomData_bmesh_get_n(&em->bm->vdata, eve->head.data, CD_SHAPEKEY, shape);
@@ -2748,7 +2748,7 @@ static int select_axis_exec(bContext *C, wmOperator *op)
                        value += limit;
 
                BM_ITER(ev, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(ev, BM_HIDDEN)) {
+                       if (!BM_TestHFlag(ev, BM_ELEM_HIDDEN)) {
                                switch(mode) {
                                case -1: /* aligned */
                                        if (fabs(ev->co[axis] - value) < limit)
@@ -2814,20 +2814,20 @@ static int solidify_exec(bContext *C, wmOperator *op)
 
        float thickness = RNA_float_get(op->ptr, "thickness");
 
-       if (!EDBM_InitOpf(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_SELECT, thickness)) {
+       if (!EDBM_InitOpf(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) {
                return OPERATOR_CANCELLED;
        }
 
        /* deselect only the faces in the region to be solidified (leave wire
           edges and loose verts selected, as there will be no corresponding
           geometry selected below) */
-       BMO_UnHeaderFlag_Buffer(bm, &bmop, "geom", BM_SELECT, BM_FACE);
+       BMO_UnHeaderFlag_Buffer(bm, &bmop, "geom", BM_ELEM_SELECT, BM_FACE);
 
        /* run the solidify operator */
        BMO_Exec_Op(bm, &bmop);
 
        /* select the newly generated faces */
-       BMO_HeaderFlag_Buffer(bm, &bmop, "geomout", BM_SELECT, BM_FACE);
+       BMO_HeaderFlag_Buffer(bm, &bmop, "geomout", BM_ELEM_SELECT, BM_FACE);
 
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
                return OPERATOR_CANCELLED;
@@ -3219,23 +3219,23 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
 
        ED_base_object_select(basenew, BA_DESELECT);
        
-       EDBM_CallOpf(em, wmop, "dupe geom=%hvef dest=%p", BM_SELECT, bmnew);
-       EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_SELECT, DEL_FACES);
+       EDBM_CallOpf(em, wmop, "dupe geom=%hvef dest=%p", BM_ELEM_SELECT, bmnew);
+       EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_FACES);
 
        /* clean up any loose edges */
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_HIDDEN))
+               if (BM_TestHFlag(e, BM_ELEM_HIDDEN))
                        continue;
 
                if (BM_Edge_FaceCount(e) != 0) {
                        BM_Select(em->bm, e, FALSE);
                }
        }
-       EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_SELECT, DEL_EDGES);
+       EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_EDGES);
 
        /* clean up any loose verts */
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_HIDDEN))
+               if (BM_TestHFlag(v, BM_ELEM_HIDDEN))
                        continue;
 
                if (BM_Vert_EdgeCount(v) != 0) {
@@ -3243,7 +3243,7 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
                }
        }
 
-       EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_SELECT, DEL_VERTS);
+       EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_VERTS);
 
        BM_Compute_Normals(bmnew);
        BMO_CallOpf(bmnew, "bmesh_to_mesh mesh=%p object=%p", basenew->object->data, basenew->object);
@@ -3391,13 +3391,13 @@ static int fill_mesh_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
        BMOperator bmop;
        
-       if (!EDBM_InitOpf(em, &bmop, op, "triangle_fill edges=%he", BM_SELECT))
+       if (!EDBM_InitOpf(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
        
        BMO_Exec_Op(em->bm, &bmop);
        
        /* select new geometry */
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_SELECT, BM_FACE|BM_EDGE);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_FACE|BM_EDGE);
        
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
                return OPERATOR_CANCELLED;
@@ -3429,7 +3429,7 @@ static int beautify_fill_exec(bContext *C, wmOperator *op)
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
 
-       if (!EDBM_CallOpf(em, op, "beautify_fill faces=%hf", BM_SELECT))
+       if (!EDBM_CallOpf(em, op, "beautify_fill faces=%hf", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
 
        DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
@@ -3459,7 +3459,7 @@ static int quads_convert_to_tris_exec(bContext *C, wmOperator *op)
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
 
-       if (!EDBM_CallOpf(em, op, "triangulate faces=%hf", BM_SELECT))
+       if (!EDBM_CallOpf(em, op, "triangulate faces=%hf", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
 
        DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
@@ -3496,7 +3496,7 @@ static int tris_convert_to_quads_exec(bContext *C, wmOperator *op)
 
        if (!EDBM_CallOpf(em, op, 
                "join_triangles faces=%hf limit=%f compare_sharp=%i compare_uvs=%i compare_vcols=%i compare_materials=%i", 
-               BM_SELECT, limit, dosharp, douvs, dovcols, domaterials)) 
+               BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials)) 
        {
                return OPERATOR_CANCELLED;
        }
@@ -3569,10 +3569,10 @@ static int split_mesh_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
        BMOperator bmop;
 
-       EDBM_InitOpf(em, &bmop, op, "split geom=%hvef", BM_SELECT);
+       EDBM_InitOpf(em, &bmop, op, "split geom=%hvef", BM_ELEM_SELECT);
        BMO_Exec_Op(em->bm, &bmop);
-       BM_clear_flag_all(em->bm, BM_SELECT);
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_SELECT, BM_ALL);
+       BM_clear_flag_all(em->bm, BM_ELEM_SELECT);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL);
        if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
                return OPERATOR_CANCELLED;
        }
@@ -3629,12 +3629,12 @@ static int spin_mesh_exec(bContext *C, wmOperator *op)
 
        if (!EDBM_InitOpf(em, &spinop, op,
                        "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%d ang=%f dupli=%d",
-                       BM_SELECT, cent, axis, d, steps, degr, dupli)) {
+                       BM_ELEM_SELECT, cent, axis, d, steps, degr, dupli)) {
                return OPERATOR_CANCELLED;
        }
        BMO_Exec_Op(bm, &spinop);
-       EDBM_clear_flag_all(em, BM_SELECT);
-       BMO_HeaderFlag_Buffer(bm, &spinop, "lastout", BM_SELECT, BM_ALL);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
+       BMO_HeaderFlag_Buffer(bm, &spinop, "lastout", BM_ELEM_SELECT, BM_ALL);
        if (!EDBM_FinishOp(em, &spinop, op, TRUE)) {
                return OPERATOR_CANCELLED;
        }
@@ -3720,7 +3720,7 @@ static int screw_mesh_exec(bContext *C, wmOperator *op)
                for (eed = BMIter_New(&eiter, em->bm, BM_EDGES_OF_VERT, eve);
                    eed; eed = BMIter_Step(&eiter)) {
 
-                       if (BM_TestHFlag(eed, BM_SELECT)) {
+                       if (BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                valence++;
                        }
 
@@ -3754,13 +3754,13 @@ static int screw_mesh_exec(bContext *C, wmOperator *op)
 
        if (!EDBM_InitOpf(em, &spinop, op,
                          "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%d ang=%f dupli=0",
-                         BM_SELECT, cent, axis, dvec, turns * steps, 360.0f * turns))
+                         BM_ELEM_SELECT, cent, axis, dvec, turns * steps, 360.0f * turns))
        {
                return OPERATOR_CANCELLED;
        }
        BMO_Exec_Op(bm, &spinop);
-       EDBM_clear_flag_all(em, BM_SELECT);
-       BMO_HeaderFlag_Buffer(bm, &spinop, "lastout", BM_SELECT, BM_ALL);
+       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
+       BMO_HeaderFlag_Buffer(bm, &spinop, "lastout", BM_ELEM_SELECT, BM_ALL);
        if (!EDBM_FinishOp(em, &spinop, op, TRUE)) {
                return OPERATOR_CANCELLED;
        }
@@ -4009,7 +4009,7 @@ static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag))
        amount = em->bm->totvert;
        sortblock = MEM_callocN(sizeof(xvertsort)*amount,"xsort");
        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(eve, BM_SELECT))
+               if (BM_TestHFlag(eve, BM_ELEM_SELECT))
                        sortblock[i].v1 = eve;
        }
        
@@ -4354,7 +4354,7 @@ static int mesh_noise_exec(bContext *C, wmOperator *op)
                float b2, vec[3];
                float ofs = tex->turbul / 200.0;
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(eve, BM_SELECT) && !BM_TestHFlag(eve, BM_HIDDEN)) {
+                       if (BM_TestHFlag(eve, BM_ELEM_SELECT) && !BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                                b2 = BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]);
                                if (tex->stype) ofs *= (b2 * b2);
                                vec[0] = fac * (b2 - BLI_hnoise(tex->noisesize, eve->co[0] + ofs, eve->co[1], eve->co[2]));
@@ -4367,7 +4367,7 @@ static int mesh_noise_exec(bContext *C, wmOperator *op)
        }
        else {
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(eve, BM_SELECT) && !BM_TestHFlag(eve, BM_HIDDEN)) {
+                       if (BM_TestHFlag(eve, BM_ELEM_SELECT) && !BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                                float tin, dum;
                                externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum, 0);
                                eve->co[2] += fac * tin;
@@ -4451,7 +4451,7 @@ static int mesh_bevel_exec(bContext *C, wmOperator *op)
 
                if (!EDBM_InitOpf(em, &bmop, op,
                                  "bevel geom=%hev percent=%f lengthlayer=%i use_lengths=%i use_even=%i use_dist=%i",
-                                 BM_SELECT, fac, li, 1, use_even, use_dist))
+                                 BM_ELEM_SELECT, fac, li, 1, use_even, use_dist))
                {
                        return OPERATOR_CANCELLED;
                }
@@ -4830,7 +4830,7 @@ static int bridge_edge_loops(bContext *C, wmOperator *op)
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
        
-       if (!EDBM_CallOpf(em, op, "bridge_loops edges=%he", BM_SELECT))
+       if (!EDBM_CallOpf(em, op, "bridge_loops edges=%he", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
        
        DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
index 21e4cf0d7ecf98d89f0e19fb4cb294c545128711..ec72b0ebd5457ce114dc5495761069810abb40bb 100644 (file)
@@ -95,7 +95,7 @@ void EDBM_stats_update(BMEditMesh *em)
        for (i = 0; i < 3; i++) {
                ele = BMIter_New(&iter, em->bm, iter_types[i], NULL);
                for ( ; ele; ele = BMIter_Step(&iter)) {
-                       if (BM_TestHFlag(ele, BM_SELECT)) {
+                       if (BM_TestHFlag(ele, BM_ELEM_SELECT)) {
                                (*tots[i])++;
                        }
                }
@@ -208,7 +208,7 @@ int EDBM_CallAndSelectOpf(BMEditMesh *em, wmOperator *op, const char *selectslot
        em->emcopyusers++;
 
        BMO_Exec_Op(bm, &bmop);
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, selectslot, BM_SELECT, BM_ALL);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, selectslot, BM_ELEM_SELECT, BM_ALL);
 
        va_end(list);
        return EDBM_FinishOp(em, &bmop, op, TRUE);
@@ -410,9 +410,9 @@ void EDBM_select_more(BMEditMesh *em)
 
        BMO_InitOpf(em->bm, &bmop, 
                    "regionextend geom=%hvef constrict=%d usefaces=%d",
-                   BM_SELECT, 0, usefaces);
+                   BM_ELEM_SELECT, 0, usefaces);
        BMO_Exec_Op(em->bm, &bmop);
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_SELECT, BM_ALL);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL);
        BMO_Finish_Op(em->bm, &bmop);
 
        EDBM_selectmode_flush(em);
@@ -425,9 +425,9 @@ void EDBM_select_less(BMEditMesh *em)
 
        BMO_InitOpf(em->bm, &bmop, 
                    "regionextend geom=%hvef constrict=%d usefaces=%d",
-                   BM_SELECT, 0, usefaces);
+                   BM_ELEM_SELECT, 0, usefaces);
        BMO_Exec_Op(em->bm, &bmop);
-       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_SELECT, BM_ALL);
+       BMO_HeaderFlag_Buffer(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL);
        BMO_Finish_Op(em->bm, &bmop);
 
        EDBM_selectmode_flush(em);
@@ -475,12 +475,12 @@ void EDBM_clear_flag_all(BMEditMesh *em, const char hflag)
        BMHeader *ele;
        int i;
 
-       if (hflag & BM_SELECT)
+       if (hflag & BM_ELEM_SELECT)
                BM_clear_selection_history(em->bm);
 
        for (i = 0; i < 3; i++) {
                BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) {
-                       if (hflag & BM_SELECT) BM_Select(em->bm, ele, FALSE);
+                       if (hflag & BM_ELEM_SELECT) BM_Select(em->bm, ele, FALSE);
                        BM_ClearHFlag(ele, hflag);
                }
        }
@@ -498,7 +498,7 @@ void EDBM_set_flag_all(BMEditMesh *em, const char hflag)
        for (i = 0; i < 3; i++) {
                ele = BMIter_New(&iter, em->bm, iter_types[i], NULL);
                for ( ; ele; ele = BMIter_Step(&iter)) {
-                       if (hflag & BM_SELECT) {
+                       if (hflag & BM_ELEM_SELECT) {
                                BM_Select(em->bm, ele, TRUE);
                        }
                        else {
@@ -621,7 +621,7 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
 
        /* generate UvMapVert array */
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!selected || ((!BM_TestHFlag(efa, BM_HIDDEN)) && BM_TestHFlag(efa, BM_SELECT)))
+               if (!selected || ((!BM_TestHFlag(efa, BM_ELEM_HIDDEN)) && BM_TestHFlag(efa, BM_ELEM_SELECT)))
                        totuv += efa->len;
        }
 
@@ -649,7 +649,7 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
        
        a = 0;
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!selected || ((!BM_TestHFlag(efa, BM_HIDDEN)) && BM_TestHFlag(efa, BM_SELECT))) {
+               if (!selected || ((!BM_TestHFlag(efa, BM_ELEM_HIDDEN)) && BM_TestHFlag(efa, BM_ELEM_SELECT))) {
                        i = 0;
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                buf->tfindex = i;
@@ -761,7 +761,7 @@ UvElementMap *EDBM_make_uv_element_map(BMEditMesh *em, int selected, int do_isla
 
        /* generate UvElement array */
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!selected || ((!BM_TestHFlag(efa, BM_HIDDEN)) && BM_TestHFlag(efa, BM_SELECT)))
+               if (!selected || ((!BM_TestHFlag(efa, BM_ELEM_HIDDEN)) && BM_TestHFlag(efa, BM_ELEM_SELECT)))
                        totuv += efa->len;
        }
 
@@ -782,7 +782,7 @@ UvElementMap *EDBM_make_uv_element_map(BMEditMesh *em, int selected, int do_isla
        }
 
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!selected || ((!BM_TestHFlag(efa, BM_HIDDEN)) && BM_TestHFlag(efa, BM_SELECT))) {
+               if (!selected || ((!BM_TestHFlag(efa, BM_ELEM_HIDDEN)) && BM_TestHFlag(efa, BM_ELEM_SELECT))) {
                        i = 0;
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                buf->tfindex = i;
@@ -1060,7 +1060,7 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em, const short use_select)
        BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
 
                /* temporary for testing, check for selection */
-               if (use_select && !BM_TestHFlag(v, BM_SELECT)) {
+               if (use_select && !BM_TestHFlag(v, BM_ELEM_SELECT)) {
                        /* do nothing */
                }
                else {
@@ -1146,10 +1146,10 @@ void EDBM_ApplyMirrorCache(BMEditMesh *em, const int sel_from, const int sel_to)
        BLI_assert(em->vert_index != NULL);
 
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_SELECT) == sel_from) {
+               if (BM_TestHFlag(v, BM_ELEM_SELECT) == sel_from) {
                        BMVert *mirr = EDBM_GetMirrorVert(em, v);
                        if (mirr) {
-                               if (BM_TestHFlag(mirr, BM_SELECT) == sel_to) {
+                               if (BM_TestHFlag(mirr, BM_ELEM_SELECT) == sel_to) {
                                        copy_v3_v3(mirr->co, v->co);
                                        mirr->co[0] *= -1.0f;
                                }
index f78a2bdf49c5dbff0a85bfb6185c63d290e51b21..ee99443e8ef373ce0e84cbfd0f337dffe3b57539 100644 (file)
@@ -200,7 +200,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
        }
 
        if (!lcd->extend) {
-               EDBM_clear_flag_all(lcd->em, BM_SELECT);
+               EDBM_clear_flag_all(lcd->em, BM_ELEM_SELECT);
        }
 
        if (select) {
@@ -308,7 +308,7 @@ static void ringsel_finish(bContext *C, wmOperator *op)
                edgering_sel(lcd, cuts, 1);
                
                if (lcd->do_cut) {
-                       BM_esubdivideflag(lcd->ob, em->bm, BM_SELECT, 0.0f, 
+                       BM_esubdivideflag(lcd->ob, em->bm, BM_ELEM_SELECT, 0.0f, 
                                          0.0f, 0, cuts, SUBDIV_SELECT_LOOPCUT, 
                                          SUBD_PATH, 0, 0, 0);
                        
index 4c345f8e3d5ed7ab25a6e327d591873f4163730b..9ed177f0f7da289fc360532271293e816aec40a6 100644 (file)
@@ -215,7 +215,7 @@ int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
                BLI_assert(CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV));
 
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_SELECT))
+                       if (!BM_TestHFlag(efa, BM_ELEM_SELECT))
                                continue;
 
                        i = 0;
index fc27f64617033041a556793439824b2b2abd38bb..bb3d6a88c5d05c05d59ad6071a3e3c84c90d7fe9 100644 (file)
@@ -499,7 +499,7 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
                        if(targetPolyIdx > 0) {
                                /* set target poly idx to other selected faces */
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if(BM_TestHFlag(efa, BM_SELECT) && efa != efa_act)  {
+                                       if(BM_TestHFlag(efa, BM_ELEM_SELECT) && efa != efa_act)  {
                                                int* recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_RECAST);
                                                *recastDataBlock= targetPolyIdx;
                                        }
@@ -584,7 +584,7 @@ static int navmesh_face_add_exec(bContext *C, wmOperator *UNUSED(op))
                        /*XXX this originally went last to first, but that isn't possible anymore*/
                        
                        BM_ITER(ef, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if(BM_TestHFlag(ef, BM_SELECT)) {
+                               if(BM_TestHFlag(ef, BM_ELEM_SELECT)) {
                                        int *recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST);
                                        *recastDataBlock= targetPolyIdx;
                                }
index 12bf5742dbcd248cc401cfd8ab345f3690485a78..bf018a7599564bc6a7aebb83012beed2c42c82e7 100644 (file)
@@ -79,7 +79,7 @@ static int return_editmesh_indexar(BMEditMesh *em, int *tot, int **indexar, floa
        int *index, nr, totvert=0;
        
        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if(BM_TestHFlag(eve, BM_SELECT)) totvert++;
+               if(BM_TestHFlag(eve, BM_ELEM_SELECT)) totvert++;
        }
        if(totvert==0) return 0;
        
@@ -89,7 +89,7 @@ static int return_editmesh_indexar(BMEditMesh *em, int *tot, int **indexar, floa
        zero_v3(cent);
        
        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if(BM_TestHFlag(eve, BM_SELECT)) {
+               if(BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                        *index= nr; index++;
                        add_v3_v3(cent, eve->co);
                }
index 8745c8ca6e6423e7395a6c00f19a70e30203a57b..63c15734803d3f5131e104a5523a1aca5a38e2c6 100644 (file)
@@ -138,7 +138,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
                makeDerivedMesh(scene, obedit, em, CD_MASK_BAREMESH, 0);
 
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(eve, BM_SELECT)) {
+                       if (BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                if(v1==0) v1= nr;
                                else if(v2==0) v2= nr;
                                else if(v3==0) v3= nr;
index 8335d8943d234fb74a36d392bdaa621a8d24b91d..f5c80694e54f609e54d407cefc8fbe6bb05045ab 100644 (file)
@@ -206,7 +206,7 @@ static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_to
                                        i = 0;
                                        if (use_vert_sel) {
                                                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                                                       (*dvert_arr)[i] = BM_TestHFlag(eve, BM_SELECT) ?
+                                                       (*dvert_arr)[i] = BM_TestHFlag(eve, BM_ELEM_SELECT) ?
                                                                          CustomData_em_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT) : NULL;
                                                        i++;
                                                }
@@ -593,7 +593,7 @@ static void vgroup_select_verts(Object *ob, int select)
                        BMVert *eve;
 
                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                               if (!BM_TestHFlag(eve, BM_HIDDEN)) {
+                               if (!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                                        dv= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
                                        if (defvert_find_index(dv, def_nr)) {
                                                BM_Select(em->bm, eve, select);
@@ -1311,8 +1311,8 @@ static void vgroup_blend(Object *ob)
                vg_users= MEM_callocN(sizeof(int)*dvert_tot, "vgroup_blend_i");
 
                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                       sel1= BM_TestHFlag(eed->v1, BM_SELECT);
-                       sel2= BM_TestHFlag(eed->v2, BM_SELECT);
+                       sel1= BM_TestHFlag(eed->v1, BM_ELEM_SELECT);
+                       sel2= BM_TestHFlag(eed->v2, BM_ELEM_SELECT);
 
                        if(sel1 != sel2) {
                                /* i1 is always the selected one */
@@ -1343,7 +1343,7 @@ static void vgroup_blend(Object *ob)
 
                i= 0;
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if(BM_TestHFlag(eve, BM_SELECT) && vg_users[i] > 0) {
+                       if(BM_TestHFlag(eve, BM_ELEM_SELECT) && vg_users[i] > 0) {
                                /* TODO, we may want object mode blending */
                                if(em)  dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
                                else    dvert= dvert_array+i;
@@ -1559,8 +1559,8 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v
                        /* Go through the list of editverts and assign them */
                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
                                if((eve_mirr= EDBM_GetMirrorVert(em, eve))) {
-                                       sel= BM_TestHFlag(eve, BM_SELECT);
-                                       sel_mirr= BM_TestHFlag(eve_mirr, BM_SELECT);
+                                       sel= BM_TestHFlag(eve, BM_ELEM_SELECT);
+                                       sel_mirr= BM_TestHFlag(eve_mirr, BM_ELEM_SELECT);
 
                                        if((sel || sel_mirr) && (eve != eve_mirr)) {
                                                dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
@@ -1785,7 +1785,7 @@ static void vgroup_active_remove_verts(Object *ob, const int allverts, bDeformGr
                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
                                dv= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
 
-                               if(dv && dv->dw && (allverts || BM_TestHFlag(eve, BM_SELECT))) {
+                               if(dv && dv->dw && (allverts || BM_TestHFlag(eve, BM_ELEM_SELECT))) {
                                        MDeformWeight *dw = defvert_find_index(dv, def_nr);
                                        defvert_remove_group(dv, dw); /* dw can be NULL */
                                }
@@ -1985,7 +1985,7 @@ static void vgroup_assign_verts(Object *ob, const float weight)
 
                        /* Go through the list of editverts and assign them */
                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                               if (BM_TestHFlag(eve, BM_SELECT)) {
+                               if (BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                        MDeformWeight *dw;
                                        dv= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT); /* can be NULL */
                                        dw= defvert_verify_index(dv, def_nr);
index 6f4acd7ab4d749b1065a602850134b2c616224ac..fb844de33c39544a043e23808ac081246f8d6419 100644 (file)
@@ -171,7 +171,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
 
                        if(em) {
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if(BM_TestHFlag(efa, BM_SELECT))
+                                       if(BM_TestHFlag(efa, BM_ELEM_SELECT))
                                                efa->mat_nr= ob->actcol-1;
                                }
                        }
index 6f38cfc78ef60e02c9239b90b9325af0ad7c008a..4734d54497db6e1e760afec499532cb9ddaf8776 100644 (file)
@@ -549,7 +549,7 @@ static int draw_em_tf_mapped__set_draw(void *userData, int index)
        BMEditMesh *em = data->em;
        BMFace *efa= EDBM_get_face_for_index(em, index);
 
-       if (efa==NULL || BM_TestHFlag(efa, BM_HIDDEN)) {
+       if (efa==NULL || BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
                return 0;
        }
        else {
@@ -911,7 +911,7 @@ static int tex_mat_set_face_editmesh_cb(void *userData, int index)
        Mesh *me = (Mesh*)data->me;
        BMFace *efa= EDBM_get_face_for_index(me->edit_btmesh, index);
 
-       return !BM_TestHFlag(efa, BM_HIDDEN);
+       return !BM_TestHFlag(efa, BM_ELEM_HIDDEN);
 }
 
 void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, DerivedMesh *dm, int draw_flags)
index 84c8eaf590236bec56507d3d8fdb6d02660c8911..226073c2cf99dcd647e4b9608f7d788fd7abf7fb 100644 (file)
@@ -2006,7 +2006,7 @@ static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co
        foreachScreenVert_userData *data = userData;
        BMVert *eve = EDBM_get_vert_for_index(data->vc.em, index);
 
-       if (!BM_TestHFlag(eve, BM_HIDDEN)) {
+       if (!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                short s[2]= {IS_CLIPPED, 0};
 
                if (data->clipVerts != V3D_CLIP_TEST_OFF) {
@@ -2084,7 +2084,7 @@ static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0
        foreachScreenEdge_userData *data = userData;
        BMEdge *eed = EDBM_get_edge_for_index(data->vc.em, index);
 
-       if (!BM_TestHFlag(eed, BM_HIDDEN)) {
+       if (!BM_TestHFlag(eed, BM_ELEM_HIDDEN)) {
                short s[2][2];
 
                if (data->clipVerts == V3D_CLIP_TEST_RV3D_CLIPPING) {
@@ -2141,7 +2141,7 @@ static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *ce
        foreachScreenFace_userData *data = userData;
        BMFace *efa = EDBM_get_face_for_index(data->vc.em, index);
 
-       if (efa && !BM_TestHFlag(efa, BM_HIDDEN)) {
+       if (efa && !BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
                float cent2[3];
                short s[2];
 
@@ -2244,7 +2244,7 @@ static void draw_dm_face_normals__mapFunc(void *userData, int index, float *cent
        drawDMNormal_userData *data = userData;
        BMFace *efa = EDBM_get_face_for_index(data->em, index);
 
-       if (!BM_TestHFlag(efa, BM_HIDDEN)) {
+       if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
                glVertex3fv(cent);
                glVertex3f(cent[0] + no[0] * data->normalsize,
                           cent[1] + no[1] * data->normalsize,
@@ -2268,7 +2268,7 @@ static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent
        BMFace *efa = EDBM_get_face_for_index(((void **)userData)[0], index);
        int sel = *(((int **)userData)[1]);
        
-       if (efa && !BM_TestHFlag(efa, BM_HIDDEN) && BM_TestHFlag(efa, BM_SELECT)==sel) {
+       if (efa && !BM_TestHFlag(efa, BM_ELEM_HIDDEN) && BM_TestHFlag(efa, BM_ELEM_SELECT)==sel) {
                bglVertex3fv(cent);
        }
 }
@@ -2286,7 +2286,7 @@ static void draw_dm_vert_normals__mapFunc(void *userData, int index, float *co,
        drawDMNormal_userData *data = userData;
        BMVert *eve = EDBM_get_vert_for_index(data->em, index);
 
-       if (!BM_TestHFlag(eve, BM_HIDDEN)) {
+       if (!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                glVertex3fv(co);
 
                if (no_f) {
@@ -2319,7 +2319,7 @@ static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *
        drawDMVerts_userData * data = userData;
        BMVert *eve = EDBM_get_vert_for_index(data->em, index);
 
-       if (!BM_TestHFlag(eve, BM_HIDDEN) && BM_TestHFlag(eve, BM_SELECT)==data->sel) {
+       if (!BM_TestHFlag(eve, BM_ELEM_HIDDEN) && BM_TestHFlag(eve, BM_ELEM_SELECT)==data->sel) {
                /* draw active larger - need to stop/start point drawing for this :/ */
                if (eve==data->eve_act) {
                        float size = UI_GetThemeValuef(TH_VERTEX_SIZE);
@@ -2363,11 +2363,11 @@ static int draw_dm_edges_sel__setDrawOptions(void *userData, int index)
 
        eed = EDBM_get_edge_for_index(data->em, index);
 
-       if (!BM_TestHFlag(eed, BM_HIDDEN)) {
+       if (!BM_TestHFlag(eed, BM_ELEM_HIDDEN)) {
                if (eed==data->eed_act) {
                        glColor4ubv(data->actCol);
                } else {
-                       if (BM_TestHFlag(eed, BM_SELECT)) {
+                       if (BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                col = data->selCol;
                        } else {
                                col = data->baseCol;
@@ -2398,7 +2398,7 @@ static void draw_dm_edges_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *ba
        /* Draw edges */
 static int draw_dm_edges__setDrawOptions(void *userData, int index)
 {
-       return !BM_TestHFlag(EDBM_get_edge_for_index(userData, index), BM_HIDDEN);
+       return !BM_TestHFlag(EDBM_get_edge_for_index(userData, index), BM_ELEM_HIDDEN);
 }
 static void draw_dm_edges(BMEditMesh *em, DerivedMesh *dm) 
 {
@@ -2408,14 +2408,14 @@ static void draw_dm_edges(BMEditMesh *em, DerivedMesh *dm)
        /* Draw edges with color interpolated based on selection */
 static int draw_dm_edges_sel_interp__setDrawOptions(void *userData, int index)
 {
-       return !BM_TestHFlag(EDBM_get_edge_for_index(((void**)userData)[0], index), BM_HIDDEN);
+       return !BM_TestHFlag(EDBM_get_edge_for_index(((void**)userData)[0], index), BM_ELEM_HIDDEN);
 }
 static void draw_dm_edges_sel_interp__setDrawInterpOptions(void *userData, int index, float t)
 {
        BMEdge *eed = EDBM_get_edge_for_index(((void**)userData)[0], index);
        unsigned char **cols = userData;
-       unsigned char *col0 = cols[(BM_TestHFlag(eed->v1, BM_SELECT))?2:1];
-       unsigned char *col1 = cols[(BM_TestHFlag(eed->v2, BM_SELECT))?2:1];
+       unsigned char *col0 = cols[(BM_TestHFlag(eed->v1, BM_ELEM_SELECT))?2:1];
+       unsigned char *col1 = cols[(BM_TestHFlag(eed->v2, BM_ELEM_SELECT))?2:1];
 
        glColor4ub(     col0[0] + (col1[0]-col0[0])*t,
                                col0[1] + (col1[1]-col0[1])*t,
@@ -2435,7 +2435,7 @@ static int draw_dm_edges_seams__setDrawOptions(void *userData, int index)
 {
        BMEdge *eed = EDBM_get_edge_for_index(userData, index);
 
-       return !BM_TestHFlag(eed, BM_HIDDEN) && BM_TestHFlag(eed, BM_SEAM);
+       return !BM_TestHFlag(eed, BM_ELEM_HIDDEN) && BM_TestHFlag(eed, BM_ELEM_SEAM);
 }
 
 static void draw_dm_edges_seams(BMEditMesh *em, DerivedMesh *dm)
@@ -2448,7 +2448,7 @@ static int draw_dm_edges_sharp__setDrawOptions(void *userData, int index)
 {
        BMEdge *eed = EDBM_get_edge_for_index(userData, index);
 
-       return !BM_TestHFlag(eed, BM_HIDDEN) && BM_TestHFlag(eed, BM_SHARP);
+       return !BM_TestHFlag(eed, BM_ELEM_HIDDEN) && BM_TestHFlag(eed, BM_ELEM_SHARP);
 }
 static void draw_dm_edges_sharp(BMEditMesh *em, DerivedMesh *dm)
 {
@@ -2467,12 +2467,12 @@ static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *UNU
        if (!efa)
                return 0;
        
-       if (!BM_TestHFlag(efa, BM_HIDDEN)) {
+       if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
                if (efa == data->efa_act) {
                        glColor4ubv(data->cols[2]);
                        return 2; /* stipple */
                } else {
-                       col = data->cols[BM_TestHFlag(efa, BM_SELECT)?1:0];
+                       col = data->cols[BM_TestHFlag(efa, BM_ELEM_SELECT)?1:0];
                        if (col[3]==0) return 0;
                        glColor4ubv(col);
                        return 1;
@@ -2502,8 +2502,8 @@ static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int
        if(efa == data->efa_act || next_efa == data->efa_act)
                return 0;
 
-       col = data->cols[BM_TestHFlag(efa, BM_SELECT)?1:0];
-       next_col = data->cols[BM_TestHFlag(next_efa, BM_SELECT)?1:0];
+       col = data->cols[BM_TestHFlag(efa, BM_ELEM_SELECT)?1:0];
+       next_col = data->cols[BM_TestHFlag(next_efa, BM_ELEM_SELECT)?1:0];
 
        if(col[3]==0 || next_col[3]==0)
                return 0;
@@ -2536,7 +2536,7 @@ static int draw_dm_creases__setDrawOptions(void *userData, int index)
        if (!crease)
                return 0;
        
-       if (!BM_TestHFlag(eed, BM_HIDDEN) && *crease!=0.0f) {
+       if (!BM_TestHFlag(eed, BM_ELEM_HIDDEN) && *crease!=0.0f) {
                UI_ThemeColorBlend(TH_WIRE, TH_EDGE_CREASE, *crease);
                return 1;
        } else {
@@ -2559,7 +2559,7 @@ static int draw_dm_bweights__setDrawOptions(void *userData, int index)
        if (!bweight)
                return 0;
        
-       if (!BM_TestHFlag(eed, BM_HIDDEN) && *bweight!=0.0f) {
+       if (!BM_TestHFlag(eed, BM_ELEM_HIDDEN) && *bweight!=0.0f) {
                UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, *bweight);
                return 1;
        } else {
@@ -2575,7 +2575,7 @@ static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, floa
        if (!bweight)
                return;
        
-       if (!BM_TestHFlag(eve, BM_HIDDEN) && *bweight!=0.0f) {
+       if (!BM_TestHFlag(eve, BM_ELEM_HIDDEN) && *bweight!=0.0f) {
                UI_ThemeColorBlend(TH_VERTEX, TH_VERTEX_SELECT, *bweight);
                bglVertex3fv(co);
        }
@@ -2756,8 +2756,8 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
                eed = BMIter_New(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
                for(; eed; eed=BMIter_Step(&iter)) {
                        /* draw selected edges, or edges next to selected verts while draging */
-                       if(BM_TestHFlag(eed, BM_SELECT) ||
-                               (do_moving && (BM_TestHFlag(eed->v1, BM_SELECT) || BM_TestHFlag(eed->v2, BM_SELECT) ))) {
+                       if(BM_TestHFlag(eed, BM_ELEM_SELECT) ||
+                               (do_moving && (BM_TestHFlag(eed->v1, BM_ELEM_SELECT) || BM_TestHFlag(eed->v2, BM_ELEM_SELECT) ))) {
 
                                copy_v3_v3(v1, eed->v1->co);
                                copy_v3_v3(v2, eed->v2->co);
@@ -2789,7 +2789,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
                int n;
 
 #define DRAW_EM_MEASURE_STATS_FACEAREA()                                             \
-               if (BM_TestHFlag(f, BM_SELECT)) {                                            \
+               if (BM_TestHFlag(f, BM_ELEM_SELECT)) {                                            \
                        mul_v3_fl(vmid, 1.0/n);                                                  \
                        if(unit->system)                                                         \
                                bUnit_AsString(numstr, sizeof(numstr), area*unit->scale_length,      \
@@ -2864,8 +2864,8 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
                                        mul_mat3_m4_v3(ob->obmat, v3);
                                }
 
-                               if ( (BM_TestHFlag(efa, BM_SELECT)) ||
-                                    (do_moving && BM_TestHFlag(loop->v, BM_SELECT)))
+                               if ( (BM_TestHFlag(efa, BM_ELEM_SELECT)) ||
+                                    (do_moving && BM_TestHFlag(loop->v, BM_ELEM_SELECT)))
                                {
                                        BLI_snprintf(numstr, sizeof(numstr), "%.3g", RAD2DEGF(angle_v3v3v3(v1, v2, v3)));
                                        interp_v3_v3v3(fvec, vmid, v2, 0.8f);
@@ -2894,7 +2894,7 @@ static void draw_em_indices(BMEditMesh *em)
        if (em->selectmode & SCE_SELECT_VERTEX) {
                UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
                BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(v, BM_SELECT)) {
+                       if (BM_TestHFlag(v, BM_ELEM_SELECT)) {
                                sprintf(numstr, "%d", i);
                                view3d_cached_text_draw_add(v->co, numstr, 0, V3D_CACHE_TEXT_ASCII, col);
                        }
@@ -2906,7 +2906,7 @@ static void draw_em_indices(BMEditMesh *em)
                i= 0;
                UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
                BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(e, BM_SELECT)) {
+                       if (BM_TestHFlag(e, BM_ELEM_SELECT)) {
                                sprintf(numstr, "%d", i);
                                mid_v3_v3v3(pos, e->v1->co, e->v2->co);
                                view3d_cached_text_draw_add(pos, numstr, 0, V3D_CACHE_TEXT_ASCII, col);
@@ -2919,7 +2919,7 @@ static void draw_em_indices(BMEditMesh *em)
                i= 0;
                UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
                BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(f, BM_SELECT)) {
+                       if (BM_TestHFlag(f, BM_ELEM_SELECT)) {
                                BM_Compute_Face_CenterMean(bm, f, pos);
                                sprintf(numstr, "%d", i);
                                view3d_cached_text_draw_add(pos, numstr, 0, V3D_CACHE_TEXT_ASCII, col);
@@ -2933,7 +2933,7 @@ static int draw_em_fancy__setFaceOpts(void *userData, int index, int *UNUSED(dra
 {
        BMFace *efa = EDBM_get_face_for_index(userData, index);
 
-       if (efa && !BM_TestHFlag(efa, BM_HIDDEN)) {
+       if (efa && !BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
                GPU_enable_material(efa->mat_nr+1, NULL);
                return 1;
        }
@@ -2945,7 +2945,7 @@ static int draw_em_fancy__setGLSLFaceOpts(void *userData, int index)
 {
        BMFace *efa = EDBM_get_face_for_index(userData, index);
 
-       return !BM_TestHFlag(efa, BM_HIDDEN);
+       return !BM_TestHFlag(efa, BM_ELEM_HIDDEN);
 }
 
 static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
@@ -7050,7 +7050,7 @@ static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float
        int offset = (intptr_t) ptrs[0];
        BMVert *eve = EDBM_get_vert_for_index(ptrs[1], index);
 
-       if (!BM_TestHFlag(eve, BM_HIDDEN)) {
+       if (!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                WM_set_framebuffer_index_color(offset+index);
                bglVertex3fv(co);
        }
@@ -7072,7 +7072,7 @@ static int bbs_mesh_wire__setDrawOptions(void *userData, int index)
        int offset = (intptr_t) ptrs[0];
        BMEdge *eed = EDBM_get_edge_for_index(ptrs[1], index);
 
-       if (!BM_TestHFlag(eed, BM_HIDDEN)) {
+       if (!BM_TestHFlag(eed, BM_ELEM_HIDDEN)) {
                WM_set_framebuffer_index_color(offset+index);
                return 1;
        } else {
@@ -7089,7 +7089,7 @@ static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *U
 {
        BMFace *efa = EDBM_get_face_for_index(((void**)userData)[0], index);
        
-       if (efa && !BM_TestHFlag(efa, BM_HIDDEN)) {
+       if (efa && !BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
                if (((void**)userData)[1]) {
                        WM_set_framebuffer_index_color(index+1);
                }
@@ -7103,7 +7103,7 @@ static void bbs_mesh_solid__drawCenter(void *userData, int index, float *cent, f
 {
        BMFace *efa = EDBM_get_face_for_index(((void**)userData)[0], index);
 
-       if (!BM_TestHFlag(efa, BM_HIDDEN)) {
+       if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
                WM_set_framebuffer_index_color(index+1);
 
                bglVertex3fv(cent);
index 55481d6aa7243a4c70af7153275fee098f9b3e86..d2ea10de2ba1f57ae57f3cb2277505d541e2b39d 100644 (file)
@@ -161,7 +161,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                BMIter iter;
                
                BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                       if(BM_TestHFlag(eve, BM_SELECT)) {
+                       if(BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                evedef= eve;
                                tot++;
                                add_v3_v3(median, eve->co);
@@ -169,7 +169,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                }
 
                BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                       if(BM_TestHFlag(eed, BM_SELECT)) {
+                       if(BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                float *f;
 
                                totedge++;
@@ -419,7 +419,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                        if(len_v3(median) > 0.000001f) {
 
                                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                                       if(BM_TestHFlag(eve, BM_SELECT)) {
+                                       if(BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                                add_v3_v3(eve->co, median);
                                        }
                                }
@@ -435,7 +435,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                        /* simple case */
 
                                        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                                               if(BM_TestHFlag(eed, BM_SELECT)) {
+                                               if(BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                                        float *crease = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE);
                                                        if (!crease) break;
                                                        
@@ -457,7 +457,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                                const float sca= median_new / median_orig;
                                                
                                                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                                                       if(BM_TestHFlag(eed, BM_SELECT) && !BM_TestHFlag(eed, BM_HIDDEN)) {
+                                                       if(BM_TestHFlag(eed, BM_ELEM_SELECT) && !BM_TestHFlag(eed, BM_ELEM_HIDDEN)) {
                                                                float *crease = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE);
                                                                
                                                                if (!crease) break;
@@ -472,7 +472,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                                const float sca= (1.0f - median_new) / (1.0f - median_orig);
 
                                                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                                                       if(BM_TestHFlag(eed, BM_SELECT) && !BM_TestHFlag(eed, BM_HIDDEN)) {
+                                                       if(BM_TestHFlag(eed, BM_ELEM_SELECT) && !BM_TestHFlag(eed, BM_ELEM_HIDDEN)) {
                                                                float *crease = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE);
                                                                if (!crease) break;
 
@@ -688,7 +688,7 @@ static void vgroup_copy_active_to_sel(Object *ob)
                int index= 0;
 
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if(BM_TestHFlag(eve, BM_SELECT) && eve != eve_act) {
+                       if(BM_TestHFlag(eve, BM_ELEM_SELECT) && eve != eve_act) {
                                dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
                                if(dvert) {
                                        defvert_copy(dvert, dvert_act);
@@ -733,7 +733,7 @@ static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr)
 
                eve = BMIter_New(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
                for (index=0; eve; eve=BMIter_Step(&iter), index++) {
-                       if(BM_TestHFlag(eve, BM_SELECT) && eve != eve_act) {
+                       if(BM_TestHFlag(eve, BM_ELEM_SELECT) && eve != eve_act) {
                                dv= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
                                dw= defvert_find_index(dv, def_nr);
                                if (dw) {
index 5d7901a481b8c87dcdab19f2e7e76b993d3c5e3a..d0a4ac14c20c9bb5a14083973b9e4d7b6c9cd203 100644 (file)
@@ -173,7 +173,7 @@ static void EDBM_backbuf_checkAndSelectVerts(BMEditMesh *em, int select)
 
        eve = BMIter_New(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
        for ( ; eve; eve=BMIter_Step(&iter), index++) {
-               if(!BM_TestHFlag(eve, BM_HIDDEN)) {
+               if(!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                        if(EDBM_check_backbuf(index)) {
                                BM_Select_Vert(em->bm, eve, select);
                        }
@@ -189,7 +189,7 @@ static void EDBM_backbuf_checkAndSelectEdges(BMEditMesh *em, int select)
 
        eed = BMIter_New(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
        for ( ; eed; eed=BMIter_Step(&iter), index++) {
-               if(!BM_TestHFlag(eed, BM_HIDDEN)) {
+               if(!BM_TestHFlag(eed, BM_ELEM_HIDDEN)) {
                        if(EDBM_check_backbuf(index)) {
                                BM_Select_Edge(em->bm, eed, select);
                        }
@@ -205,7 +205,7 @@ static void EDBM_backbuf_checkAndSelectFaces(BMEditMesh *em, int select)
 
        efa = BMIter_New(&iter, em->bm, BM_FACES_OF_MESH, NULL);
        for ( ; efa; efa=BMIter_Step(&iter), index++) {
-               if(!BM_TestHFlag(efa, BM_HIDDEN)) {
+               if(!BM_TestHFlag(efa, BM_ELEM_HIDDEN)) {
                        if(EDBM_check_backbuf(index)) {
                                BM_Select_Face(em->bm, efa, select);
                        }
@@ -525,7 +525,7 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves,
        data.pass = 0;
 
        if (extend == 0 && select)
-               EDBM_clear_flag_all(vc->em, BM_SELECT);
+               EDBM_clear_flag_all(vc->em, BM_ELEM_SELECT);
 
         /* for non zbuf projections, dont change the GL state */
        ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
@@ -1782,7 +1782,7 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
        data.done = 0;
 
        if (extend == 0 && select)
-               EDBM_clear_flag_all(vc->em, BM_SELECT);
+               EDBM_clear_flag_all(vc->em, BM_ELEM_SELECT);
 
        /* for non zbuf projections, dont change the GL state */
        ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
index 7cb64977a28ab3be1df6711f878c858b868d4f53..de15ea992567ca78835e6faf9ead934d0f24cb75 100644 (file)
@@ -242,7 +242,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
                tottrans= 0;
                if(em->selectmode & SCE_SELECT_VERTEX) {
                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                               if(!BM_TestHFlag(eve, BM_HIDDEN) && BM_TestHFlag(eve, BM_SELECT)) {
+                               if(!BM_TestHFlag(eve, BM_ELEM_HIDDEN) && BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                        BM_SetIndex(eve, 1); /* set_dirty! */
                                        tottrans++;
                                }
@@ -256,7 +256,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
                                BM_SetIndex(eve, 0); /* set_dirty! */
 
                        BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-                               if(!BM_TestHFlag(eed, BM_HIDDEN) && BM_TestHFlag(eed, BM_SELECT)) {
+                               if(!BM_TestHFlag(eed, BM_ELEM_HIDDEN) && BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                        BM_SetIndex(eed->v1, 1); /* set_dirty! */
                                        BM_SetIndex(eed->v2, 1); /* set_dirty! */
                                }
@@ -272,7 +272,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
                                BM_SetIndex(eve, 0); /* set_dirty! */
 
                        BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) {
-                               if(!BM_TestHFlag(efa, BM_HIDDEN) && BM_TestHFlag(efa, BM_SELECT)) {
+                               if(!BM_TestHFlag(efa, BM_ELEM_HIDDEN) && BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                        BMIter liter;
                                        BMLoop *l;
                                        
index a09abd6d5aa6d405e0e12c997e04f19744025a31..b15085efd7599b8549f1e3051b2b77282efae776 100644 (file)
@@ -4294,7 +4294,7 @@ static BMEdge *get_other_edge(BMesh *bm, BMVert *v, BMEdge *e)
        BMEdge *e2;
 
        BM_ITER(e2, &iter, bm, BM_EDGES_OF_VERT, v) {
-               if (BM_TestHFlag(e2, BM_SELECT) && e2 != e)
+               if (BM_TestHFlag(e2, BM_ELEM_SELECT) && e2 != e)
                        return e2;
        }
 
@@ -4392,10 +4392,10 @@ static int createSlideVerts(TransInfo *t)
        
        /*ensure valid selection*/
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_SELECT)) {
+               if (BM_TestHFlag(v, BM_ELEM_SELECT)) {
                        numsel = 0;
                        BM_ITER(e, &iter2, em->bm, BM_EDGES_OF_VERT, v) {
-                               if (BM_TestHFlag(e, BM_SELECT)) {
+                               if (BM_TestHFlag(e, BM_ELEM_SELECT)) {
                                        /*BMESH_TODO: this is probably very evil,
                                          set v->e to a selected edge*/
                                        v->e = e;
@@ -4411,7 +4411,7 @@ static int createSlideVerts(TransInfo *t)
        }
 
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_SELECT)) {
+               if (BM_TestHFlag(e, BM_ELEM_SELECT)) {
                        if (BM_Edge_FaceCount(e) != 2)
                                return 0; //can only handle exactly 2 faces around each edge
                }
@@ -4419,13 +4419,13 @@ static int createSlideVerts(TransInfo *t)
 
        j = 0;
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_SELECT)) {
-                       BM_SetHFlag(v, BM_TMP_TAG);
+               if (BM_TestHFlag(v, BM_ELEM_SELECT)) {
+                       BM_SetHFlag(v, BM_ELEM_TAG);
                        BLI_smallhash_insert(&table, (uintptr_t)v, SET_INT_IN_POINTER(j));
                        j += 1;
                }
                else {
-                       BM_ClearHFlag(v, BM_TMP_TAG);
+                       BM_ClearHFlag(v, BM_ELEM_TAG);
                }
        }
 
@@ -4438,7 +4438,7 @@ static int createSlideVerts(TransInfo *t)
        while (1) {
                v = NULL;
                BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BM_TestHFlag(v, BM_TMP_TAG))
+                       if (BM_TestHFlag(v, BM_ELEM_TAG))
                                break;
 
                }
@@ -4465,13 +4465,13 @@ static int createSlideVerts(TransInfo *t)
 
                        numsel += 1;
 
-                       if (!BM_TestHFlag(BM_OtherEdgeVert(e, v), BM_TMP_TAG))
+                       if (!BM_TestHFlag(BM_OtherEdgeVert(e, v), BM_ELEM_TAG))
                                break;
 
                        v = BM_OtherEdgeVert(e, v);
                } while (e != first->e);
 
-               BM_ClearHFlag(v, BM_TMP_TAG);
+               BM_ClearHFlag(v, BM_ELEM_TAG);
 
                l1 = l2 = l = NULL;
                l1 = e->l;
@@ -4527,8 +4527,8 @@ static int createSlideVerts(TransInfo *t)
                                        sub_v3_v3v3(sv->downvec, BM_OtherEdgeVert(l->e, v)->co, v->co);
                                }
 
-                               BM_ClearHFlag(v, BM_TMP_TAG);
-                               BM_ClearHFlag(v2, BM_TMP_TAG);
+                               BM_ClearHFlag(v, BM_ELEM_TAG);
+                               BM_ClearHFlag(v2, BM_ELEM_TAG);
                                
                                j += 2;
                                break;
@@ -4539,12 +4539,12 @@ static int createSlideVerts(TransInfo *t)
 
                        j += 1;
 
-                       BM_ClearHFlag(v, BM_TMP_TAG);
-                       BM_ClearHFlag(v2, BM_TMP_TAG);
+                       BM_ClearHFlag(v, BM_ELEM_TAG);
+                       BM_ClearHFlag(v2, BM_ELEM_TAG);
                } while (e != first->e && l1);
        }
 
-       //EDBM_clear_flag_all(em, BM_SELECT);
+       //EDBM_clear_flag_all(em, BM_ELEM_SELECT);
 
        sld->sv = tempsv;
        sld->totsv = j;
@@ -4555,7 +4555,7 @@ static int createSlideVerts(TransInfo *t)
        zero_v3(lastvec); zero_v3(dir);
        ee = le = NULL;
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_SELECT)) {
+               if (BM_TestHFlag(e, BM_ELEM_SELECT)) {
                        BMIter iter2;
                        BMEdge *e2;
                        float vec1[3], dis2, mval[2] = {t->mval[0], t->mval[1]}, d;
@@ -4566,7 +4566,7 @@ static int createSlideVerts(TransInfo *t)
                        for (i=0; i<2; i++) {
                                v = i?e->v1:e->v2;
                                BM_ITER(e2, &iter2, em->bm, BM_EDGES_OF_VERT, v) {
-                                       if (BM_TestHFlag(e2, BM_SELECT))
+                                       if (BM_TestHFlag(e2, BM_ELEM_SELECT))
                                                continue;
                                        
                                        if (!BMBVH_EdgeVisible(btree, e2, ar, v3d, t->obedit))
@@ -4616,12 +4616,12 @@ static int createSlideVerts(TransInfo *t)
                                BMFace *copyf = BM_Copy_Face(em->bm, f, 1, 1);
                                
                                BM_Select(em->bm, copyf, FALSE);
-                               BM_SetHFlag(copyf, BM_HIDDEN);
+                               BM_SetHFlag(copyf, BM_ELEM_HIDDEN);
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, copyf) {
                                        BM_Select(em->bm, l->v, FALSE);
-                                       BM_SetHFlag(l->v, BM_HIDDEN);
+                                       BM_SetHFlag(l->v, BM_ELEM_HIDDEN);
                                        BM_Select(em->bm, l->e, FALSE);
-                                       BM_SetHFlag(l->e, BM_HIDDEN);
+                                       BM_SetHFlag(l->e, BM_ELEM_HIDDEN);
                                }
 
                                BLI_smallhash_insert(&sld->origfaces, (uintptr_t)f, copyf);
@@ -4693,8 +4693,8 @@ void projectSVData(TransInfo *t, int final)
                        /*the face attributes of the copied face will get
                          copied over, so its necessary to save the selection
                          and hidden state*/
-                       sel = BM_TestHFlag(f, BM_SELECT);
-                       hide = BM_TestHFlag(f, BM_HIDDEN);
+                       sel = BM_TestHFlag(f, BM_ELEM_SELECT);
+                       hide = BM_TestHFlag(f, BM_ELEM_HIDDEN);
                        
                        copyf2 = BLI_smallhash_lookup(&sld->origfaces, (uintptr_t)f);
                        
@@ -4703,12 +4703,12 @@ void projectSVData(TransInfo *t, int final)
                                copyf = copyf2;
                                do_vdata = l2->v==tempsv->v;
                                
-                               if (BM_TestHFlag(l2->e, BM_SELECT) || BM_TestHFlag(l2->prev->e, BM_SELECT)) {
+                               if (BM_TestHFlag(l2->e, BM_ELEM_SELECT) || BM_TestHFlag(l2->prev->e, BM_ELEM_SELECT)) {
                                        BMLoop *l3 = l2;
                                        
                                        do_vdata = 1;
                                        
-                                       if (!BM_TestHFlag(l2->e, BM_SELECT))
+                                       if (!BM_TestHFlag(l2->e, BM_ELEM_SELECT))
                                                l3 = l3->prev;
                                        
                                        if (sld->perc < 0.0 && BM_Vert_In_Face(l3->radial_next->f, tempsv->down)) {
index 779481fb3b8ad2be1d824d73d516e3214d8439cf..794e6e0cf30efc3eb7aed6ee582d8cdae26f89b2 100644 (file)
@@ -311,8 +311,8 @@ static void createTransEdge(TransInfo *t)
        int propmode = t->flag & T_PROP_EDIT;
 
        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (!BM_TestHFlag(eed, BM_HIDDEN)) {
-                       if (BM_TestHFlag(eed, BM_SELECT)) countsel++;
+               if (!BM_TestHFlag(eed, BM_ELEM_HIDDEN)) {
+                       if (BM_TestHFlag(eed, BM_ELEM_SELECT)) countsel++;
                        if (propmode) count++;
                }
        }
@@ -333,7 +333,7 @@ static void createTransEdge(TransInfo *t)
        invert_m3_m3(smtx, mtx);
 
        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if(!BM_TestHFlag(eed, BM_HIDDEN) && (BM_TestHFlag(eed, BM_SELECT) || propmode)) { 
+               if(!BM_TestHFlag(eed, BM_ELEM_HIDDEN) && (BM_TestHFlag(eed, BM_ELEM_SELECT) || propmode)) { 
                        float *bweight = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_BWEIGHT);
                        float *crease = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE);
                        
@@ -342,7 +342,7 @@ static void createTransEdge(TransInfo *t)
                        mul_v3_fl(td->center, 0.5f);
 
                        td->loc= NULL;
-                       if (BM_TestHFlag(eed, BM_SELECT))
+                       if (BM_TestHFlag(eed, BM_ELEM_SELECT))
                                td->flag= TD_SELECTED;
                        else
                                td->flag= 0;
@@ -1885,7 +1885,7 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
        BLI_smallhash_init(visit);
 
        BM_ITER(v, &viter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_SELECT)==0 || BM_TestHFlag(v, BM_HIDDEN))
+               if (BM_TestHFlag(v, BM_ELEM_SELECT)==0 || BM_TestHFlag(v, BM_ELEM_HIDDEN))
                        continue;
                        
                
@@ -1909,7 +1909,7 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
                        float d2;
                        v3 = BM_OtherEdgeVert(e, v2);
                        
-                       if (BM_TestHFlag(v3, BM_SELECT) || BM_TestHFlag(v3, BM_HIDDEN))
+                       if (BM_TestHFlag(v3, BM_ELEM_SELECT) || BM_TestHFlag(v3, BM_ELEM_HIDDEN))
                                continue;
                        
                        sub_v3_v3v3(vec, v2->co, v3->co);
@@ -2050,10 +2050,10 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
        if(selectmode & SCE_SELECT_VERTEX) {
                BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
                        if (BM_Selected(bm, eve)) {
-                               BM_SetHFlag(eve, BM_TMP_TAG);
+                               BM_SetHFlag(eve, BM_ELEM_TAG);
                        }
                        else {
-                               BM_ClearHFlag(eve, BM_TMP_TAG);
+                               BM_ClearHFlag(eve, BM_ELEM_TAG);
                        }
                }
        }
@@ -2061,20 +2061,20 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
                BMEdge *eed;
 
                eve = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
-               for( ; eve; eve=BMIter_Step(&iter)) BM_ClearHFlag(eve, BM_TMP_TAG);
+               for( ; eve; eve=BMIter_Step(&iter)) BM_ClearHFlag(eve, BM_ELEM_TAG);
 
                eed = BMIter_New(&iter, bm, BM_EDGES_OF_MESH, NULL);
                for( ; eed; eed=BMIter_Step(&iter)) {
                        if (BM_Selected(bm, eed)) {
-                               BM_SetHFlag(eed->v1, BM_TMP_TAG);
-                               BM_SetHFlag(eed->v2, BM_TMP_TAG);
+                               BM_SetHFlag(eed->v1, BM_ELEM_TAG);
+                               BM_SetHFlag(eed->v2, BM_ELEM_TAG);
                        }
                }
        }
        else {
                BMFace *efa;
                eve = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
-               for( ; eve; eve=BMIter_Step(&iter)) BM_ClearHFlag(eve, BM_TMP_TAG);
+               for( ; eve; eve=BMIter_Step(&iter)) BM_ClearHFlag(eve, BM_ELEM_TAG);
 
                efa = BMIter_New(&iter, bm, BM_FACES_OF_MESH, NULL);
                for( ; efa; efa=BMIter_Step(&iter)) {
@@ -2084,7 +2084,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
 
                                l = BMIter_New(&liter, bm, BM_LOOPS_OF_FACE, efa);
                                for (; l; l=BMIter_Step(&liter)) {
-                                       BM_SetHFlag(l->v, BM_TMP_TAG);
+                                       BM_SetHFlag(l->v, BM_ELEM_TAG);
                                }
                        }
                }
@@ -2096,8 +2096,8 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
        selstate = MEM_callocN(sizeof(*selstate) * bm->totvert, __func__);
        eve = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
        for(a=0; eve; eve=BMIter_Step(&iter), a++) {
-               if (!BM_TestHFlag(eve, BM_HIDDEN)) {
-                       if (BM_TestHFlag(eve, BM_TMP_TAG)) {
+               if (!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
+                       if (BM_TestHFlag(eve, BM_ELEM_TAG)) {
                                selstate[a] = 1;
                                countsel++;
                        }
@@ -2164,7 +2164,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
        if(mirror) {
                eve = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
                for(a=0; eve; eve=BMIter_Step(&iter), a++) {
-                       if(!BM_TestHFlag(eve, BM_HIDDEN) && selstate[a] && eve->co[0]!=0.0f) {
+                       if(!BM_TestHFlag(eve, BM_ELEM_HIDDEN) && selstate[a] && eve->co[0]!=0.0f) {
                                if(eve->co[0]<0.0f)
                                {
                                        t->mirror = -1;
@@ -2177,7 +2177,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
 
        eve = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
        for(a=0; eve; eve=BMIter_Step(&iter), a++) {
-               if(!BM_TestHFlag(eve, BM_HIDDEN)) {
+               if(!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                        if(propmode || selstate[a]) {
                                float *bweight = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_BWEIGHT);
                                
@@ -2457,11 +2457,11 @@ static void createTransUVs(bContext *C, TransInfo *t)
                tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
                if(!uvedit_face_visible(scene, ima, efa, tf)) {
-                       BM_ClearHFlag(efa, BM_TMP_TAG);
+                       BM_ClearHFlag(efa, BM_ELEM_TAG);
                        continue;
                }
                
-               BM_SetHFlag(efa, BM_TMP_TAG);
+               BM_SetHFlag(efa, BM_ELEM_TAG);
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                        if (uvedit_uv_selected(em, scene, l)) 
                                countsel++;
@@ -2487,7 +2487,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
        td2d= t->data2d;
 
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!BM_TestHFlag(efa, BM_TMP_TAG))
+               if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                        continue;
 
                tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
index 1f466cff00bec860fbdbc70ff248c22709a54931..6211cff55b7189492cb817a25326377c59fd5d49 100644 (file)
@@ -320,8 +320,8 @@ int calc_manipulator_stats(const bContext *C)
                                   it is not flush down on changes */
                                if(ts->selectmode & SCE_SELECT_VERTEX) {
                                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                                               if(!BM_TestHFlag(eve, BM_HIDDEN)) {
-                                                       if(BM_TestHFlag(eve, BM_SELECT)) {
+                                               if(!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
+                                                       if(BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                                                totsel++;
                                                                calc_tw_center(scene, eve->co);
                                                        }
@@ -332,10 +332,10 @@ int calc_manipulator_stats(const bContext *C)
                                        BMIter itersub;
                                        BMEdge *eed;
                                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                                               if(!BM_TestHFlag(eve, BM_HIDDEN)) {
+                                               if(!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                                                        /* check the vertex has a selected edge, only add it once */
                                                        BM_ITER(eed, &itersub, bm, BM_EDGES_OF_VERT, eve) {
-                                                               if(BM_TestHFlag(eed, BM_SELECT)) {
+                                                               if(BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                                                        totsel++;
                                                                        calc_tw_center(scene, eve->co);
                                                                        break;
@@ -348,10 +348,10 @@ int calc_manipulator_stats(const bContext *C)
                                        BMIter itersub;
                                        BMFace *efa;
                                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                                               if(!BM_TestHFlag(eve, BM_HIDDEN)) {
+                                               if(!BM_TestHFlag(eve, BM_ELEM_HIDDEN)) {
                                                        /* check the vertex has a selected face, only add it once */
                                                        BM_ITER(efa, &itersub, bm, BM_FACES_OF_VERT, eve) {
-                                                               if(BM_TestHFlag(efa, BM_SELECT)) {
+                                                               if(BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                                                        totsel++;
                                                                        calc_tw_center(scene, eve->co);
                                                                        break;
index 0e3dfad71070890c6c798ddf50b80545968e4c25..f3bdf0b7d1ac5e3e46fa44ce2da42850df559d67 100644 (file)
@@ -617,7 +617,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                        BMIter iter;
 
                                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                               if(BM_TestHFlag(efa, BM_SELECT)) {
+                                               if(BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                                        add_v3_v3(normal, efa->no);
                                                        sub_v3_v3v3(vec,
                                                                    ((BMLoopList*)efa->loops.first)->first->v->co,
@@ -635,7 +635,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                        float cotangent[3];
                                        
                                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                                               if (BM_TestHFlag(eve, BM_SELECT)) {
+                                               if (BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                                        if (v1 == NULL) {
                                                                v1 = eve; 
                                                        }
@@ -660,7 +660,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                                BMIter iter;
                                                
                                                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                                                       if(BM_TestHFlag(eed, BM_SELECT)) {
+                                                       if(BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                                                sub_v3_v3v3(plane, eed->v2->co, eed->v1->co);
                                                                break;
                                                        }
@@ -675,7 +675,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                        BMIter iter;
                                        
                                        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                                               if(BM_TestHFlag(eed, BM_SELECT)) {
+                                               if(BM_TestHFlag(eed, BM_ELEM_SELECT)) {
                                                        /* use average vert normals as plane and edge vector as normal */
                                                        copy_v3_v3(plane, eed->v1->no);
                                                        add_v3_v3(plane, eed->v2->no);
@@ -691,7 +691,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                        BMIter iter;
 
                                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                                               if (BM_TestHFlag(eve, BM_SELECT)) {
+                                               if (BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                                        if (v1 == NULL) {
                                                                v1 = eve; 
                                                        }
@@ -712,7 +712,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                        BMIter iter;
 
                                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                                               if (BM_TestHFlag(eve, BM_SELECT)) {
+                                               if (BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                                        copy_v3_v3(normal, eve->no);
                                                        break;
                                                }
@@ -725,7 +725,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                        normal[0] = normal[1] = normal[2] = 0.0f;
 
                                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                                               if (BM_TestHFlag(eve, BM_SELECT)) {
+                                               if (BM_TestHFlag(eve, BM_ELEM_SELECT)) {
                                                        add_v3_v3(normal, eve->no);
                                                }
                                        }
index 332af6fdfcfaf6b0e52e66b2958f4d32e4b382e4..7de00e024f62009ffa738ef4a5415b82b165b583 100644 (file)
@@ -1464,7 +1464,7 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
                                                        {
                                                                efa = EDBM_get_face_for_index(em, index);
                                                                
-                                                               if (efa && BM_TestHFlag(efa, BM_HIDDEN))
+                                                               if (efa && BM_TestHFlag(efa, BM_ELEM_HIDDEN))
                                                                {
                                                                        test = 0;
                                                                } else if (efa) {
@@ -1473,7 +1473,7 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
                                                                        
                                                                        l = BMIter_New(&iter, em->bm, BM_LOOPS_OF_FACE, efa);
                                                                        for ( ; l; l=BMIter_Step(&iter)) {
-                                                                               if (BM_TestHFlag(l->v, BM_SELECT)) {
+                                                                               if (BM_TestHFlag(l->v, BM_ELEM_SELECT)) {
                                                                                        test = 0;
                                                                                        break;
                                                                                }
@@ -1548,7 +1548,7 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
                                                        {
                                                                eve = EDBM_get_vert_for_index(em, index);
                                                                
-                                                               if (eve && (BM_TestHFlag(eve, BM_HIDDEN) || BM_TestHFlag(eve, BM_SELECT)))
+                                                               if (eve && (BM_TestHFlag(eve, BM_ELEM_HIDDEN) || BM_TestHFlag(eve, BM_ELEM_SELECT)))
                                                                {
                                                                        test = 0;
                                                                }
@@ -1608,9 +1608,9 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
                                                        {
                                                                eed = EDBM_get_edge_for_index(em, index);
                                                                
-                                                               if (eed && (BM_TestHFlag(eed, BM_HIDDEN) ||
-                                                                       BM_TestHFlag(eed->v1, BM_SELECT) || 
-                                                                       BM_TestHFlag(eed->v2, BM_SELECT)))
+                                                               if (eed && (BM_TestHFlag(eed, BM_ELEM_HIDDEN) ||
+                                                                       BM_TestHFlag(eed->v1, BM_ELEM_SELECT) || 
+                                                                       BM_TestHFlag(eed->v2, BM_ELEM_SELECT)))
                                                                {
                                                                        test = 0;
                                                                }
index 26db6ff32ac7ec3ff592ba9baaf09332b9763fbd..c88f6e0d60bbd868c9aefeddcc2520146a15a3ab 100644 (file)
@@ -149,7 +149,7 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped
        BM_ElemIndex_Ensure(em->bm, BM_VERT);
 
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (!BM_TestHFlag(v, BM_SELECT) || BM_TestHFlag(v, BM_HIDDEN))
+               if (!BM_TestHFlag(v, BM_ELEM_SELECT) || BM_TestHFlag(v, BM_ELEM_HIDDEN))
                        continue;
                
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_VERT, v) {
index 41fe8ad72759f47ce66b97ecbdb55e596e0fee01..8693e3e7d6d610d835983ce149e08ffa90cb57da 100644 (file)
@@ -206,12 +206,12 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
                                totuvarea += poly_uv_area(tf_uv, efa->len);
                                
                                if(uvedit_face_visible(scene, ima, efa, tf)) {
-                                       BM_SetHFlag(efa, BM_TMP_TAG);
+                                       BM_SetHFlag(efa, BM_ELEM_TAG);
                                }
                                else {
                                        if(tf == activetf)
                                                activetf= NULL;
-                                       BM_ClearHFlag(efa, BM_TMP_TAG);
+                                       BM_ClearHFlag(efa, BM_ELEM_TAG);
                                }
                        }
                        
@@ -220,7 +220,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
                                col[1] = col[2] = 0.0;
                                glColor3fv(col);
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if(BM_TestHFlag(efa, BM_TMP_TAG)) {
+                                       if(BM_TestHFlag(efa, BM_ELEM_TAG)) {
                                                glBegin(GL_POLYGON);
                                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -232,7 +232,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
                        }
                        else {
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if(BM_TestHFlag(efa, BM_TMP_TAG)) {
+                                       if(BM_TestHFlag(efa, BM_ELEM_TAG)) {
                                                area = BM_Compute_Face_Area(em->bm, efa) / totarea;
 
                                                BLI_array_empty(tf_uv);
@@ -569,7 +569,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
                        
                        if(uvedit_face_visible(scene, ima, efa, tf)) {
-                               BM_SetHFlag(efa, BM_TMP_TAG);
+                               BM_SetHFlag(efa, BM_ELEM_TAG);
                                if(tf==activetf) continue; /* important the temp boolean is set above */
 
                                if(uvedit_face_selected(scene, em, efa))
@@ -587,7 +587,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        else {
                                if(tf == activetf)
                                        activetf= NULL;
-                               BM_ClearHFlag(efa, BM_TMP_TAG);
+                               BM_ClearHFlag(efa, BM_ELEM_TAG);
                        }
                }
                glDisable(GL_BLEND);
@@ -599,12 +599,12 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
                        if(uvedit_face_visible(scene, ima, efa, tf)) {          
-                               BM_SetHFlag(efa, BM_TMP_TAG);
+                               BM_SetHFlag(efa, BM_ELEM_TAG);
                        }
                        else {
                                if(tf == activetf)
                                        activetf= NULL;
-                               BM_ClearHFlag(efa, BM_TMP_TAG);
+                               BM_ClearHFlag(efa, BM_ELEM_TAG);
                        }
                }
                
@@ -642,7 +642,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        switch(sima->dt_uv) {
                case SI_UVDT_DASH:
                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                               if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                        continue;
                                tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
@@ -683,7 +683,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        else glColor3f(0.0f, 0.0f, 0.0f);
 
                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                               if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                        continue;
 
                                glBegin(GL_LINE_LOOP);
@@ -699,7 +699,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        cpack(0x0);
                        
                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                               if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                        continue;
 
                                glBegin(GL_LINE_LOOP);
@@ -722,7 +722,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                                        glShadeModel(GL_SMOOTH);
 
                                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                               if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                                               if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                                        continue;
 
                                                glBegin(GL_LINE_LOOP);
@@ -740,7 +740,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                                }
                                else {
                                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                               if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                                               if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                                        continue;
 
                                                glBegin(GL_LINES);
@@ -762,7 +762,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        else {
                                /* no nice edges */
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                                       if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                                continue;
                                
                                        glBegin(GL_LINE_LOOP);
@@ -795,7 +795,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                       if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                continue;
 
                        if(!uvedit_face_selected(scene, em, efa)) {
@@ -810,7 +810,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                       if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                continue;
 
                        if(uvedit_face_selected(scene, em, efa)) {
@@ -831,7 +831,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                       if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                continue;
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -849,7 +849,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                       if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                continue;
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -867,7 +867,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_TMP_TAG))
+                       if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                                continue;
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
index a3dcec011ef3847a797b497e2375f61a99bfb806..6d0468d34f5572958c8b84abd107ae432694e721 100644 (file)
@@ -254,7 +254,7 @@ static int uvedit_set_tile(Object *obedit, Image *ima, int curtile)
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
-               if(!BM_TestHFlag(efa, BM_HIDDEN) && BM_TestHFlag(efa, BM_SELECT))
+               if(!BM_TestHFlag(efa, BM_ELEM_HIDDEN) && BM_TestHFlag(efa, BM_ELEM_SELECT))
                        tf->tile= curtile; /* set tile index */
        }
 
@@ -288,9 +288,9 @@ int uvedit_face_visible_nolocal(Scene *scene, BMFace *efa)
        ToolSettings *ts= scene->toolsettings;
 
        if(ts->uv_flag & UV_SYNC_SELECTION)
-               return (BM_TestHFlag(efa, BM_HIDDEN)==0);
+               return (BM_TestHFlag(efa, BM_ELEM_HIDDEN)==0);
        else
-               return (BM_TestHFlag(efa, BM_HIDDEN)==0 && BM_TestHFlag(efa, BM_SELECT));
+               return (BM_TestHFlag(efa, BM_ELEM_HIDDEN)==0 && BM_TestHFlag(efa, BM_ELEM_SELECT));
 }
 
 int uvedit_face_visible(Scene *scene, Image *ima, BMFace *efa, MTexPoly *tf) {
@@ -307,7 +307,7 @@ int uvedit_face_selected(Scene *scene, BMEditMesh *em, BMFace *efa)
        ToolSettings *ts= scene->toolsettings;
 
        if(ts->uv_flag & UV_SYNC_SELECTION)
-               return (BM_TestHFlag(efa, BM_SELECT));
+               return (BM_TestHFlag(efa, BM_ELEM_SELECT));
        else {
                BMLoop *l;
                MLoopUV *luv;
@@ -374,12 +374,12 @@ int uvedit_edge_selected(BMEditMesh *em, Scene *scene, BMLoop *l)
 
        if(ts->uv_flag & UV_SYNC_SELECTION) {
                if(ts->selectmode & SCE_SELECT_FACE)
-                       return BM_TestHFlag(l->f, BM_SELECT);
+                       return BM_TestHFlag(l->f, BM_ELEM_SELECT);
                else if(ts->selectmode == SCE_SELECT_EDGE) {
-                       return BM_TestHFlag(l->e, BM_SELECT);
+                       return BM_TestHFlag(l->e, BM_ELEM_SELECT);
                } else
-                       return BM_TestHFlag(l->v, BM_SELECT) && 
-                              BM_TestHFlag(l->next->v, BM_SELECT);
+                       return BM_TestHFlag(l->v, BM_ELEM_SELECT) && 
+                              BM_TestHFlag(l->next->v, BM_ELEM_SELECT);
        }
        else {
                MLoopUV *luv1, *luv2;
@@ -449,9 +449,9 @@ int uvedit_uv_selected(BMEditMesh *em, Scene *scene, BMLoop *l)
 
        if(ts->uv_flag & UV_SYNC_SELECTION) {
                if(ts->selectmode & SCE_SELECT_FACE)
-                       return BM_TestHFlag(l->f, BM_SELECT);
+                       return BM_TestHFlag(l->f, BM_ELEM_SELECT);
                else
-                       return BM_TestHFlag(l->v, BM_SELECT);
+                       return BM_TestHFlag(l->v, BM_ELEM_SELECT);
        }
        else {
                MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -1418,7 +1418,7 @@ static void weld_align_uv(bContext *C, int tool)
 
                /* clear tag */
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       BM_ClearHFlag(eve, BM_TMP_TAG);
+                       BM_ClearHFlag(eve, BM_ELEM_TAG);
                }
 
                /* tag verts with a selected UV */
@@ -1430,7 +1430,7 @@ static void weld_align_uv(bContext *C, int tool)
                                        continue;
 
                                if (uvedit_uv_selected(em, scene, l)) {
-                                       BM_SetHFlag(eve, BM_TMP_TAG);
+                                       BM_SetHFlag(eve, BM_ELEM_TAG);
                                        break;
                                }
                        }
@@ -1438,11 +1438,11 @@ static void weld_align_uv(bContext *C, int tool)
 
                /* flush vertex tags to edges */
                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(eed->v1, BM_TMP_TAG) && BM_TestHFlag(eed->v2, BM_TMP_TAG)) {
-                               BM_SetHFlag(eed, BM_TMP_TAG);
+                       if (BM_TestHFlag(eed->v1, BM_ELEM_TAG) && BM_TestHFlag(eed->v2, BM_ELEM_TAG)) {
+                               BM_SetHFlag(eed, BM_ELEM_TAG);
                        }
                        else {
-                               BM_ClearHFlag(eed, BM_TMP_TAG);
+                               BM_ClearHFlag(eed, BM_ELEM_TAG);
                        }
                }
 
@@ -1451,7 +1451,7 @@ static void weld_align_uv(bContext *C, int tool)
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
                        int tot_eed_tag = 0;
                        BM_ITER(eed, &eiter, em->bm, BM_EDGES_OF_VERT, eve) {
-                               if (BM_TestHFlag(eed, BM_TMP_TAG)) {
+                               if (BM_TestHFlag(eed, BM_ELEM_TAG)) {
                                        tot_eed_tag++;
                                }
                        }
@@ -1474,15 +1474,15 @@ static void weld_align_uv(bContext *C, int tool)
                        while (eve) {
                                BLI_array_append(eve_line, eve);
                                /* dont touch again */
-                               BM_ClearHFlag(eve, BM_TMP_TAG);
+                               BM_ClearHFlag(eve, BM_ELEM_TAG);
 
                                eve_next = NULL;
 
                                /* find next eve */
                                BM_ITER(eed, &eiter, em->bm, BM_EDGES_OF_VERT, eve) {
-                                       if (BM_TestHFlag(eed, BM_TMP_TAG)) {
+                                       if (BM_TestHFlag(eed, BM_ELEM_TAG)) {
                                                BMVert *eve_other = BM_OtherEdgeVert(eed, eve);
-                                               if (BM_TestHFlag(eve_other, BM_TMP_TAG)) {
+                                               if (BM_TestHFlag(eve_other, BM_ELEM_TAG)) {
                                                        /* this is a tagged vert we didnt walk over yet, step onto it */
                                                        eve_next = eve_other;
                                                        break;
@@ -1793,10 +1793,10 @@ static void select_all_perform(bContext *C, int action)
                        EDBM_toggle_select_all(((Mesh*)obedit->data)->edit_btmesh);
                        break;
                case SEL_SELECT:
-                       EDBM_set_flag_all(em, BM_SELECT);
+                       EDBM_set_flag_all(em, BM_ELEM_SELECT);
                        break;
                case SEL_DESELECT:
-                       EDBM_clear_flag_all(em, BM_SELECT);
+                       EDBM_clear_flag_all(em, BM_ELEM_SELECT);
                        break;
                case SEL_INVERT:
                        EDBM_select_swap(em);
@@ -2481,13 +2481,13 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
                BMVert *eve;
                
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       BM_ClearHFlag(eve, BM_TMP_TAG);
+                       BM_ClearHFlag(eve, BM_ELEM_TAG);
                }
                
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(efa, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(efa, BM_ELEM_TAG)) {
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                                       BM_SetHFlag(l->v, BM_TMP_TAG);
+                                       BM_SetHFlag(l->v, BM_ELEM_TAG);
                                }
                        }
                }
@@ -2497,7 +2497,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
                        /* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                               if (BM_TestHFlag(l->v, BM_TMP_TAG)) {
+                               if (BM_TestHFlag(l->v, BM_ELEM_TAG)) {
                                        if (select)
                                                uvedit_uv_select(em, scene, l);
                                        else
@@ -2531,7 +2531,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
                
                efa = BMIter_New(&iter, em->bm, BM_FACES_OF_MESH, NULL);
                for (efa_index=0; efa; efa=BMIter_Step(&iter), efa_index++) {
-                       if (BM_TestHFlag(efa, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(efa, BM_ELEM_TAG)) {
                                /* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
                                
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -2578,7 +2578,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
        }
        else { /* SI_STICKY_DISABLE or ts->uv_flag & UV_SYNC_SELECTION */
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(efa, BM_TMP_TAG)) {
+                       if (BM_TestHFlag(efa, BM_ELEM_TAG)) {
                                if(select)
                                        uvedit_face_select(scene, em, efa);
                                else
@@ -2637,13 +2637,13 @@ static int border_select_exec(bContext *C, wmOperator *op)
 
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                        /* assume not touched */
-                       BM_ClearHFlag(efa, BM_TMP_TAG);
+                       BM_ClearHFlag(efa, BM_ELEM_TAG);
 
                        tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
                        if(uvedit_face_visible(scene, ima, efa, tf)) {
                                poly_uv_center(em, efa, cent);
                                if(BLI_in_rctf(&rectf, cent[0], cent[1])) {
-                                       BM_SetHFlag(efa, BM_TMP_TAG);
+                                       BM_SetHFlag(efa, BM_ELEM_TAG);
                                        change = 1;
                                }
                        }
@@ -2942,10 +2942,10 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
                if(!uvedit_face_visible(scene, ima, efa, tface)) {
-                       BM_ClearHFlag(efa, BM_TMP_TAG);
+                       BM_ClearHFlag(efa, BM_ELEM_TAG);
                        continue;
                } else {
-                       BM_SetHFlag(efa, BM_TMP_TAG);
+                       BM_SetHFlag(efa, BM_ELEM_TAG);
                }
 
                change = 1;
@@ -2963,7 +2963,7 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
        
        /* add all UV coords from visible, unselected UV coords as well as counting them to average later */
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!BM_TestHFlag(efa, BM_TMP_TAG))
+               if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                        continue;
 
                tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
@@ -2989,7 +2989,7 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
        
        /* copy the averaged unselected UVs back to the selected UVs */
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!BM_TestHFlag(efa, BM_TMP_TAG))
+               if (!BM_TestHFlag(efa, BM_ELEM_TAG))
                        continue;
 
                tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
@@ -3319,7 +3319,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
        if(facemode) {
                if(em->selectmode == SCE_SELECT_FACE) {
                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if (!BM_TestHFlag(efa, BM_HIDDEN) && !BM_TestHFlag(efa, BM_SELECT)) {
+                               if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN) && !BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                        BM_Select(em->bm, efa, TRUE);
                                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -3332,10 +3332,10 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                        /* enable adjacent faces to have disconnected UV selections if sticky is disabled */
                        if(!stickymode) {
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if (!BM_TestHFlag(efa, BM_HIDDEN) && !BM_TestHFlag(efa, BM_SELECT)) {
+                                       if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN) && !BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                                int totsel=0;
                                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                                                       totsel += BM_TestHFlag(l->v, BM_SELECT);
+                                                       totsel += BM_TestHFlag(l->v, BM_ELEM_SELECT);
                                                }
                                                
                                                if (!totsel) {
@@ -3350,9 +3350,9 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                }
                        } else {
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if (!BM_TestHFlag(efa, BM_HIDDEN) && !BM_TestHFlag(efa, BM_SELECT)) {
+                                       if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN) && !BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                                                       if (BM_TestHFlag(l->v, BM_SELECT)==0) {
+                                                       if (BM_TestHFlag(l->v, BM_ELEM_SELECT)==0) {
                                                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                                                luv->flag |= MLOOPUV_VERTSEL;
                                                        }
@@ -3365,7 +3365,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                }
        } else if(em->selectmode == SCE_SELECT_FACE) {
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_HIDDEN) && !BM_TestHFlag(efa, BM_SELECT)) {
+                       if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN) && !BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                        luv->flag |= MLOOPUV_VERTSEL;
@@ -3376,9 +3376,9 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                }
        } else {
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BM_TestHFlag(efa, BM_HIDDEN) && !BM_TestHFlag(efa, BM_SELECT)) {
+                       if (!BM_TestHFlag(efa, BM_ELEM_HIDDEN) && !BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                                       if (BM_TestHFlag(l->v, BM_SELECT)==0) {
+                                       if (BM_TestHFlag(l->v, BM_ELEM_SELECT)==0) {
                                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                                luv->flag |= MLOOPUV_VERTSEL;
                                        }
@@ -3567,7 +3567,7 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op)
 
                mvinit1 = vmap->vert[BM_GetIndex(editedge->v1)];
                if(mark_seams)
-                       BM_ClearHFlag(editedge, BM_SEAM);
+                       BM_ClearHFlag(editedge, BM_ELEM_SEAM);
 
                for(mv1 = mvinit1; mv1 && !faces_separated; mv1 = mv1->next) {
                        if(mv1->separate && commonFaces)
@@ -3616,9 +3616,9 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op)
 
                if(faces_separated) {
                        if(mark_seams)
-                               BM_SetHFlag(editedge, BM_SEAM);
+                               BM_SetHFlag(editedge, BM_ELEM_SEAM);
                        if(mark_sharp)
-                               BM_SetHFlag(editedge, BM_SHARP);
+                               BM_SetHFlag(editedge, BM_ELEM_SHARP);
                }
        }
 
@@ -3667,7 +3667,7 @@ static int mark_seam_exec(bContext *C, wmOperator *UNUSED(op))
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                BM_ITER(loop, &liter, bm, BM_LOOPS_OF_FACE, efa) {
                        if(uvedit_edge_selected(em, scene, loop)) {
-                               BM_SetHFlag(loop, BM_SEAM);
+                               BM_SetHFlag(loop, BM_ELEM_SEAM);
                        }
                }
        }
index 4d6524653aac3d3c2d1b768449b57e057b27eda4..9427eb87920a15bf6ae2e62ff53a7d2756372901 100644 (file)
@@ -158,10 +158,10 @@ static int uvedit_have_selection(Scene *scene, BMEditMesh *em, short implicit)
           so we can cancel the operator early */
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) {
-                       if(BM_TestHFlag(efa, BM_HIDDEN))
+                       if(BM_TestHFlag(efa, BM_ELEM_HIDDEN))
                                continue;
                }
-               else if(BM_TestHFlag(efa, BM_HIDDEN) || !BM_TestHFlag(efa, BM_SELECT))
+               else if(BM_TestHFlag(efa, BM_ELEM_HIDDEN) || !BM_TestHFlag(efa, BM_ELEM_SELECT))
                        continue;
        
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -223,7 +223,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
                float *uv[4];
                int lsel;
 
-               if((BM_TestHFlag(efa, BM_HIDDEN)) || (sel && BM_TestHFlag(efa, BM_SELECT)==0))
+               if((BM_TestHFlag(efa, BM_ELEM_HIDDEN)) || (sel && BM_TestHFlag(efa, BM_ELEM_SELECT)==0))
                        continue;
 
                /* tf= (MTexPoly *)CustomData_em_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
@@ -308,7 +308,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
 
        if(!implicit) {
                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                       if(BM_TestHFlag(eed, BM_SEAM)) {
+                       if(BM_TestHFlag(eed, BM_ELEM_SEAM)) {
                                ParamKey vkeys[2];
                                vkeys[0] = (ParamKey)BM_GetIndex(eed->v1);
                                vkeys[1] = (ParamKey)BM_GetIndex(eed->v2);
@@ -890,7 +890,7 @@ static void uv_map_transform_center(Scene *scene, View3D *v3d, float *result,
                        max[0]= max[1]= max[2]= -1e20f; 
                        
                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL)  {
-                               if(BM_TestHFlag(efa, BM_SELECT)) {
+                               if(BM_TestHFlag(efa, BM_ELEM_SELECT)) {
                                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                                DO_MINMAX(l->v->co, min, max);
                                        }
@@ -1042,7 +1042,7 @@ static void correct_uv_aspect(BMEditMesh *em)
 
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                        tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
-                       if (!BM_TestHFlag(efa, BM_SELECT) || BM_TestHFlag(efa, BM_HIDDEN))
+                       if (!BM_TestHFlag(efa, BM_ELEM_SELECT) || BM_TestHFlag(efa, BM_ELEM_HIDDEN))
                                continue;
                        
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -1056,7 +1056,7 @@ static void correct_uv_aspect(BMEditMesh *em)
 
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                        tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
-                       if (!BM_TestHFlag(efa, BM_SELECT)||BM_TestHFlag(efa, BM_HIDDEN))
+                  &