bmesh api cleanup
authorCampbell Barton <ideasman42@gmail.com>
Sat, 25 Feb 2012 22:23:40 +0000 (22:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 25 Feb 2012 22:23:40 +0000 (22:23 +0000)
* better type safety for BM_elem_flag_* and BM_elem_index_* functions.
* add BMElem type to be used where BMFace/Edge/Vert/Loop can be interchanged.
* fix bug in select manifold, found when making functions more strict.

20 files changed:
source/blender/bmesh/bmesh.h
source/blender/bmesh/bmesh_class.h
source/blender/bmesh/bmesh_marking.h
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_inline.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/bmo_mesh_conv.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_selecthistory.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/mesh/bmesh_utils.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/transform/transform_conversions.c
source/blender/modifiers/intern/MOD_array.c
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/bmesh/bmesh_py_types.h

index a3f7c07e69d4dd37eac87476b3bdd5917214818d..c04bc919e5a13daa82f3664e23f0a97e7fcaecee 100644 (file)
@@ -144,17 +144,19 @@ BMFace *BM_face_create_quad_tri(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, B
 BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, int len, int nodouble);
 
 /* stuff for dealing with header flags */
-BM_INLINE char BM_elem_flag_test(const void *element, const char hflag);
-
-/* stuff for dealing with header flags */
-BM_INLINE void BM_elem_flag_enable(void *element, const char hflag);
-
-/* stuff for dealing with header flags */
-BM_INLINE void BM_elem_flag_disable(void *element, const char hflag);
-
-/* stuff for dealing BM_elem_flag_toggle header flags */
-BM_INLINE void BM_elem_flag_toggle(void *element, const char hflag);
-BM_INLINE void BM_elem_flag_merge(void *element_a, void *element_b);
+#define BM_elem_flag_test(ele, hflag)      _bm_elem_flag_test    (&(ele)->head, hflag)
+#define BM_elem_flag_enable(ele, hflag)    _bm_elem_flag_enable  (&(ele)->head, hflag)
+#define BM_elem_flag_disable(ele, hflag)   _bm_elem_flag_disable (&(ele)->head, hflag)
+#define BM_elem_flag_set(ele, hflag, val)  _bm_elem_flag_set     (&(ele)->head, hflag, val)
+#define BM_elem_flag_toggle(ele, hflag)    _bm_elem_flag_toggle  (&(ele)->head, hflag)
+#define BM_elem_flag_merge(ele_a, ele_b)   _bm_elem_flag_merge   (&(ele_a)->head, &(ele_b)->head)
+
+BM_INLINE char _bm_elem_flag_test(const BMHeader *element, const char hflag);
+BM_INLINE void _bm_elem_flag_enable(BMHeader *element, const char hflag);
+BM_INLINE void _bm_elem_flag_disable(BMHeader *element, const char hflag);
+BM_INLINE void _bm_elem_flag_set(BMHeader *ele, const char hflag, const int val);
+BM_INLINE void _bm_elem_flag_toggle(BMHeader *ele, const char hflag);
+BM_INLINE void _bm_elem_flag_merge(BMHeader *ele_a, BMHeader *ele_b);
 
 /* notes on BM_elem_index_set(...) usage,
  * Set index is sometimes abused as temp storage, other times we cant be
@@ -185,8 +187,10 @@ BM_INLINE void BM_elem_flag_merge(void *element_a, void *element_b);
  *                    assume each case they are dirty.
  * - campbell */
 
-BM_INLINE void BM_elem_index_set(void *element, const int index);
-BM_INLINE int  BM_elem_index_get(const void *element);
+#define BM_elem_index_get(ele)           _bm_elem_index_get(&(ele)->head)
+#define BM_elem_index_set(ele, index)    _bm_elem_index_set(&(ele)->head, index)
+BM_INLINE int  _bm_elem_index_get(const BMHeader *ele);
+BM_INLINE void _bm_elem_index_set(BMHeader *ele, const int index);
 
 /* todo */
 BMFace *BM_face_copy(BMesh *bm, BMFace *f, const short copyverts, const short copyedges);
index 6c052a402c9067fc0873852c43662f76fb028386..77fcfe6a82008349b313d4c64307e4dc5814a8e2 100644 (file)
@@ -111,6 +111,11 @@ typedef struct BMElemF {
        struct BMFlagLayer *oflags; /* keep after header, an array of flags, mostly used by the operator stack */
 } BMElemF;
 
+/* can cast anything to this, including BMLoop */
+typedef struct BMElem {
+       BMHeader head;
+} BMElem;
+
 #ifdef USE_BMESH_HOLES
 /* eventually, this structure will be used for supporting holes in faces */
 typedef struct BMLoopList {
index 9b45ac1039488cd67aa607d2ff84d6dfeed808ae..02935d033547806b08c6676683e9d1e5354e19de 100644 (file)
@@ -30,7 +30,7 @@
 typedef struct BMEditSelection
 {
        struct BMEditSelection *next, *prev;
-       void *data;
+       BMElem *ele;
        char htype;
 } BMEditSelection;
 
@@ -66,9 +66,9 @@ void BM_editselection_center(BMesh *bm, float r_center[3], BMEditSelection *ese)
 void BM_editselection_normal(float r_normal[3], BMEditSelection *ese);
 void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese);
 
-int  BM_select_history_check(BMesh *bm, void *data);
-void BM_select_history_remove(BMesh *bm, void *data);
-void BM_select_history_store(BMesh *bm, void *data);
+int  BM_select_history_check(BMesh *bm, const BMElem *ele);
+void BM_select_history_remove(BMesh *bm, BMElem *ele);
+void BM_select_history_store(BMesh *bm, BMElem *ele);
 void BM_select_history_validate(BMesh *bm);
 void BM_select_history_clear(BMesh *em);
 
index 202d43c67c0e3d4f54f925afe84831ee83ccca82..399975c2e4813e262f1f28b50255a3b043162a18 100644 (file)
@@ -566,7 +566,7 @@ void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *sour
                return;
 
        /* First we copy select */
-       if (BM_elem_flag_test(source, BM_ELEM_SELECT)) {
+       if (BM_elem_flag_test((BMElem *)sheader, BM_ELEM_SELECT)) {
                BM_elem_select_set(target_mesh, target, TRUE);
        }
        
@@ -706,11 +706,11 @@ BMesh *BM_mesh_copy(BMesh *bmold)
                void *ele = NULL;
 
                if (ese->htype == BM_VERT)
-                       ele = vtable[BM_elem_index_get(ese->data)];
+                       ele = vtable[BM_elem_index_get(ese->ele)];
                else if (ese->htype == BM_EDGE)
-                       ele = etable[BM_elem_index_get(ese->data)];
+                       ele = etable[BM_elem_index_get(ese->ele)];
                else if (ese->htype == BM_FACE) {
-                       ele = ftable[BM_elem_index_get(ese->data)];
+                       ele = ftable[BM_elem_index_get(ese->ele)];
                }
                else {
                        BLI_assert(0);
index b855c4b865a4e31c7b05233ea6de7402bddc9474..0f2932fde2423a5840f38e838b21937661982096 100644 (file)
 
 #include "bmesh.h"
 
-BM_INLINE char BM_elem_flag_test(const void *element, const char hflag)
+BM_INLINE char _bm_elem_flag_test(const BMHeader *ele, const char hflag)
 {
-       return ((const BMHeader *)element)->hflag & hflag;
+       return ele->hflag & hflag;
 }
 
-BM_INLINE void BM_elem_flag_enable(void *element, const char hflag)
+BM_INLINE void _bm_elem_flag_enable(BMHeader *ele, const char hflag)
 {
-       ((BMHeader *)element)->hflag |= hflag;
+       ele->hflag |= hflag;
 }
 
-BM_INLINE void BM_elem_flag_disable(void *element, const char hflag)
+BM_INLINE void _bm_elem_flag_disable(BMHeader *ele, const char hflag)
 {
-       ((BMHeader *)element)->hflag &= ~hflag;
+       ele->hflag &= ~hflag;
 }
 
-BM_INLINE void BM_elem_flag_set(void *element, const char hflag, const int val)
+BM_INLINE void _bm_elem_flag_set(BMHeader *ele, const char hflag, const int val)
 {
-       if (val)  BM_elem_flag_enable(element,  hflag);
-       else      BM_elem_flag_disable(element, hflag);
+       if (val)  _bm_elem_flag_enable(ele,  hflag);
+       else      _bm_elem_flag_disable(ele, hflag);
 }
 
-BM_INLINE void BM_elem_flag_toggle(void *element, const char hflag)
+BM_INLINE void _bm_elem_flag_toggle(BMHeader *ele, const char hflag)
 {
-       ((BMHeader *)element)->hflag ^= hflag;
+       ele->hflag ^= hflag;
 }
 
-BM_INLINE void BM_elem_flag_merge(void *element_a, void *element_b)
+BM_INLINE void _bm_elem_flag_merge(BMHeader *ele_a, BMHeader *ele_b)
 {
-       ((BMHeader *)element_a)->hflag =
-       ((BMHeader *)element_b)->hflag = (((BMHeader *)element_a)->hflag |
-                                         ((BMHeader *)element_b)->hflag);
+       ele_a->hflag = ele_b->hflag = ele_a->hflag | ele_b->hflag;
 }
 
-BM_INLINE void BM_elem_index_set(void *element, const int index)
+
+BM_INLINE void _bm_elem_index_set(BMHeader *ele, const int index)
 {
-       ((BMHeader *)element)->index = index;
+       ele->index = index;
 }
 
-BM_INLINE int BM_elem_index_get(const void *element)
+BM_INLINE int _bm_elem_index_get(const BMHeader *ele)
 {
-       return ((BMHeader *)element)->index;
+       return ele->index;
 }
 
 #endif /* __BMESH_INLINE_C__ */
index be542dfef0f1b188b8e4a88aad4f198bb190628e..78c85e089e14fa0967c6a447cc99741462804af9 100644 (file)
@@ -55,7 +55,7 @@
 static void recount_totsels(BMesh *bm)
 {
        BMIter iter;
-       BMHeader *ele;
+       BMElem *ele;
        const char iter_types[3] = {BM_VERTS_OF_MESH,
                                    BM_EDGES_OF_MESH,
                                    BM_FACES_OF_MESH};
@@ -124,7 +124,7 @@ void BM_mesh_select_mode_flush(BMesh *bm)
                        if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
                                l_iter = l_first = BM_FACE_FIRST_LOOP(f);
                                do {
-                                       if (!BM_elem_flag_test(&(l_iter->e->head), BM_ELEM_SELECT)) {
+                                       if (!BM_elem_flag_test(l_iter->e, BM_ELEM_SELECT)) {
                                                ok = FALSE;
                                                break;
                                        }
@@ -286,13 +286,13 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
        if (select) {
                if (!BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel += 1;
 
-               BM_elem_flag_enable(&(e->head), BM_ELEM_SELECT);
+               BM_elem_flag_enable(e, BM_ELEM_SELECT);
                BM_elem_select_set(bm, e->v1, TRUE);
                BM_elem_select_set(bm, e->v2, TRUE);
        }
        else {
                if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1;
-               BM_elem_flag_disable(&(e->head), BM_ELEM_SELECT);
+               BM_elem_flag_disable(e, BM_ELEM_SELECT);
 
                if ( bm->selectmode == SCE_SELECT_EDGE ||
                     bm->selectmode == SCE_SELECT_FACE ||
@@ -352,7 +352,7 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
                        bm->totfacesel++;
                }
 
-               BM_elem_flag_enable(&(f->head), BM_ELEM_SELECT);
+               BM_elem_flag_enable(f, BM_ELEM_SELECT);
                l_iter = l_first = BM_FACE_FIRST_LOOP(f);
                do {
                        BM_vert_select_set(bm, l_iter->v, TRUE);
@@ -364,7 +364,7 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
                BMLoop *l;
 
                if (BM_elem_flag_test(f, BM_ELEM_SELECT)) bm->totfacesel -= 1;
-               BM_elem_flag_disable(&(f->head), BM_ELEM_SELECT);
+               BM_elem_flag_disable(f, BM_ELEM_SELECT);
 
                /* flush down to edges */
                BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
@@ -427,7 +427,7 @@ void BM_select_mode_set(BMesh *bm, int selectmode)
                for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts))
                        BM_elem_flag_disable(v, 0);
                for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
-                       if (BM_elem_flag_test(&(e->head), BM_ELEM_SELECT)) {
+                       if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
                                BM_edge_select_set(bm, e, TRUE);
                        }
                }
@@ -437,7 +437,7 @@ void BM_select_mode_set(BMesh *bm, int selectmode)
                for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges))
                        BM_elem_flag_disable(e, 0);
                for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
-                       if (BM_elem_flag_test(&(f->head), BM_ELEM_SELECT)) {
+                       if (BM_elem_flag_test(f, BM_ELEM_SELECT)) {
                                BM_face_select_set(bm, f, TRUE);
                        }
                }
@@ -448,26 +448,26 @@ void BM_select_mode_set(BMesh *bm, int selectmode)
 
 int BM_mesh_count_flag(struct BMesh *bm, const char htype, const char hflag, int respecthide)
 {
-       BMHeader *head;
+       BMElem *ele;
        BMIter iter;
        int tot = 0;
 
        if (htype & BM_VERT) {
-               for (head = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); head; head = BM_iter_step(&iter)) {
-                       if (respecthide && BM_elem_flag_test(head, BM_ELEM_HIDDEN)) continue;
-                       if (BM_elem_flag_test(head, hflag)) tot++;
+               for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) {
+                       if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue;
+                       if (BM_elem_flag_test(ele, hflag)) tot++;
                }
        }
        if (htype & BM_EDGE) {
-               for (head = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL); head; head = BM_iter_step(&iter)) {
-                       if (respecthide && BM_elem_flag_test(head, BM_ELEM_HIDDEN)) continue;
-                       if (BM_elem_flag_test(head, hflag)) tot++;
+               for (ele = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) {
+                       if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue;
+                       if (BM_elem_flag_test(ele, hflag)) tot++;
                }
        }
        if (htype & BM_FACE) {
-               for (head = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); head; head = BM_iter_step(&iter)) {
-                       if (respecthide && BM_elem_flag_test(head, BM_ELEM_HIDDEN)) continue;
-                       if (BM_elem_flag_test(head, hflag)) tot++;
+               for (ele = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) {
+                       if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue;
+                       if (BM_elem_flag_test(ele, hflag)) tot++;
                }
        }
 
@@ -515,7 +515,7 @@ BMFace *BM_active_face_get(BMesh *bm, int sloppy)
                ese = bm->selected.last;
                for ( ; ese; ese = ese->prev) {
                        if (ese->htype == BM_FACE) {
-                               f = (BMFace *)ese->data;
+                               f = (BMFace *)ese->ele;
                                
                                if (BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
                                        f = NULL;
@@ -549,16 +549,16 @@ BMFace *BM_active_face_get(BMesh *bm, int sloppy)
 void BM_editselection_center(BMesh *bm, float r_center[3], BMEditSelection *ese)
 {
        if (ese->htype == BM_VERT) {
-               BMVert *eve = ese->data;
+               BMVert *eve = (BMVert *)ese->ele;
                copy_v3_v3(r_center, eve->co);
        }
        else if (ese->htype == BM_EDGE) {
-               BMEdge *eed = ese->data;
+               BMEdge *eed = (BMEdge *)ese->ele;
                add_v3_v3v3(r_center, eed->v1->co, eed->v2->co);
                mul_v3_fl(r_center, 0.5);
        }
        else if (ese->htype == BM_FACE) {
-               BMFace *efa = ese->data;
+               BMFace *efa = (BMFace *)ese->ele;
                BM_face_center_bounds_calc(bm, efa, r_center);
        }
 }
@@ -566,11 +566,11 @@ void BM_editselection_center(BMesh *bm, float r_center[3], BMEditSelection *ese)
 void BM_editselection_normal(float r_normal[3], BMEditSelection *ese)
 {
        if (ese->htype == BM_VERT) {
-               BMVert *eve = ese->data;
+               BMVert *eve = (BMVert *)ese->ele;
                copy_v3_v3(r_normal, eve->no);
        }
        else if (ese->htype == BM_EDGE) {
-               BMEdge *eed = ese->data;
+               BMEdge *eed = (BMEdge *)ese->ele;
                float plane[3]; /* need a plane to correct the normal */
                float vec[3]; /* temp vec storage */
                
@@ -587,7 +587,7 @@ void BM_editselection_normal(float r_normal[3], BMEditSelection *ese)
                
        }
        else if (ese->htype == BM_FACE) {
-               BMFace *efa = ese->data;
+               BMFace *efa = (BMFace *)ese->ele;
                copy_v3_v3(r_normal, efa->no);
        }
 }
@@ -600,7 +600,7 @@ void BM_editselection_normal(float r_normal[3], BMEditSelection *ese)
 void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese)
 {
        if (ese->htype == BM_VERT) {
-               BMVert *eve = ese->data;
+               BMVert *eve = (BMVert *)ese->ele;
                float vec[3] = {0.0f, 0.0f, 0.0f};
                
                if (ese->prev) { /* use previously selected data to make a useful vertex plane */
@@ -619,7 +619,7 @@ void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese)
                }
        }
        else if (ese->htype == BM_EDGE) {
-               BMEdge *eed = ese->data;
+               BMEdge *eed = (BMEdge *)ese->ele;
 
                /* the plane is simple, it runs along the edge
                 * however selecting different edges can swap the direction of the y axis.
@@ -635,7 +635,7 @@ void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese)
                
        }
        else if (ese->htype == BM_FACE) {
-               BMFace *efa = ese->data;
+               BMFace *efa = (BMFace *)ese->ele;
                float vec[3] = {0.0f, 0.0f, 0.0f};
                
                /* for now, use face normal */
@@ -693,12 +693,12 @@ void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese)
        normalize_v3(r_plane);
 }
 
-int BM_select_history_check(BMesh *bm, void *data)
+int BM_select_history_check(BMesh *bm, const BMElem *ele)
 {
        BMEditSelection *ese;
        
        for (ese = bm->selected.first; ese; ese = ese->next) {
-               if (ese->data == data) {
+               if (ese->ele == ele) {
                        return TRUE;
                }
        }
@@ -706,11 +706,11 @@ int BM_select_history_check(BMesh *bm, void *data)
        return FALSE;
 }
 
-void BM_select_history_remove(BMesh *bm, void *data)
+void BM_select_history_remove(BMesh *bm, BMElem *ele)
 {
        BMEditSelection *ese;
        for (ese = bm->selected.first; ese; ese = ese->next) {
-               if (ese->data == data) {
+               if (ese->ele == ele) {
                        BLI_freelinkN(&(bm->selected), ese);
                        break;
                }
@@ -723,13 +723,13 @@ void BM_select_history_clear(BMesh *bm)
        bm->selected.first = bm->selected.last = NULL;
 }
 
-void BM_select_history_store(BMesh *bm, void *data)
+void BM_select_history_store(BMesh *bm, BMElem *ele)
 {
        BMEditSelection *ese;
-       if (!BM_select_history_check(bm, data)) {
+       if (!BM_select_history_check(bm, ele)) {
                ese = (BMEditSelection *) MEM_callocN(sizeof(BMEditSelection), "BMEdit Selection");
-               ese->htype = ((BMHeader *)data)->htype;
-               ese->data = data;
+               ese->htype = ((BMHeader *)ele)->htype;
+               ese->ele = ele;
                BLI_addtail(&(bm->selected), ese);
        }
 }
@@ -742,7 +742,7 @@ void BM_select_history_validate(BMesh *bm)
 
        while (ese) {
                nextese = ese->next;
-               if (!BM_elem_flag_test(ese->data, BM_ELEM_SELECT)) {
+               if (!BM_elem_flag_test(ese->ele, BM_ELEM_SELECT)) {
                        BLI_freelinkN(&(bm->selected), ese);
                }
                ese = nextese;
@@ -755,7 +755,7 @@ void BM_mesh_elem_flag_disable_all(BMesh *bm, const char htype, const char hflag
                                    BM_EDGES_OF_MESH,
                                    BM_FACES_OF_MESH};
        BMIter iter;
-       BMHeader *ele;
+       BMElem *ele;
        int i;
 
        if (hflag & BM_ELEM_SELECT) {
@@ -781,7 +781,7 @@ void BM_mesh_elem_flag_enable_all(BMesh *bm, const char htype, const char hflag)
                                    BM_EDGES_OF_MESH,
                                    BM_FACES_OF_MESH};
        BMIter iter;
-       BMHeader *ele;
+       BMElem *ele;
        int i;
 
        if (hflag & BM_ELEM_SELECT) {
index b5132312d3c775cf859e6ec87ef4ed09de1027eb..097c87ca1c68e4d14fd370d7a0a7bf43f92d889c 100644 (file)
@@ -478,7 +478,7 @@ void bmesh_end_edit(BMesh *bm, int flag)
 void BM_mesh_elem_index_ensure(BMesh *bm, const char hflag)
 {
        BMIter iter;
-       BMHeader *ele;
+       BMElem *ele;
 
 #ifdef DEBUG
        BM_ELEM_INDEX_VALIDATE(bm, "Should Never Fail!", __func__);
@@ -552,7 +552,7 @@ void BM_mesh_elem_index_validate(BMesh *bm, const char *location, const char *fu
        const char *type_names[3] = {"vert", "edge", "face"};
 
        BMIter iter;
-       BMHeader *ele;
+       BMElem *ele;
        int i;
        int is_any_error = 0;
 
index 31e141a77e014d47f147622fe1c4947a6c016b02..2966af9baf8cc78a1cbbd6c8715b330189d1c788 100644 (file)
@@ -463,7 +463,7 @@ static void bmesh_kill_only_vert(BMesh *bm, BMVert *v)
        bm->totvert--;
        bm->elem_index_dirty |= BM_VERT;
 
-       BM_select_history_remove(bm, v);
+       BM_select_history_remove(bm, (BMElem *)v);
        if (v->head.data)
                CustomData_bmesh_free_block(&bm->vdata, &v->head.data);
 
@@ -476,7 +476,7 @@ static void bmesh_kill_only_edge(BMesh *bm, BMEdge *e)
        bm->totedge--;
        bm->elem_index_dirty |= BM_EDGE;
 
-       BM_select_history_remove(bm, e);
+       BM_select_history_remove(bm, (BMElem *)e);
 
        if (e->head.data)
                CustomData_bmesh_free_block(&bm->edata, &e->head.data);
@@ -493,7 +493,7 @@ static void bmesh_kill_only_face(BMesh *bm, BMFace *f)
        bm->totface--;
        bm->elem_index_dirty |= BM_FACE;
 
-       BM_select_history_remove(bm, f);
+       BM_select_history_remove(bm, (BMElem *)f);
 
        if (f->head.data)
                CustomData_bmesh_free_block(&bm->pdata, &f->head.data);
index f0898734d4c5c97727e95ddfef4863757c9c5b94..af291eca072a7c97574092271a6a877240e0c451 100644 (file)
@@ -693,7 +693,7 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
                          const char hflag, const char htype)
 {
        BMIter elements;
-       BMHeader *e;
+       BMElem *ele;
        BMOpSlot *output = BMO_slot_get(op, slotname);
        int totelement = 0, i = 0;
        
@@ -703,27 +703,27 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
                bmo_slot_buffer_alloc(op, slotname, totelement);
 
                if (htype & BM_VERT) {
-                       for (e = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
-                               if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && BM_elem_flag_test(e, hflag)) {
-                                       ((BMHeader **)output->data.p)[i] = e;
+                       for (ele = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
+                               if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+                                       ((BMElem **)output->data.p)[i] = ele;
                                        i++;
                                }
                        }
                }
 
                if (htype & BM_EDGE) {
-                       for (e = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
-                               if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && BM_elem_flag_test(e, hflag)) {
-                                       ((BMHeader **)output->data.p)[i] = e;
+                       for (ele = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
+                               if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+                                       ((BMElem **)output->data.p)[i] = ele;
                                        i++;
                                }
                        }
                }
 
                if (htype & BM_FACE) {
-                       for (e = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
-                               if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && BM_elem_flag_test(e, hflag)) {
-                                       ((BMHeader **)output->data.p)[i] = e;
+                       for (ele = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
+                               if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+                                       ((BMElem **)output->data.p)[i] = ele;
                                        i++;
                                }
                        }
@@ -796,7 +796,7 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotnam
                                   const char hflag, const char htype, char do_flush_select)
 {
        BMOpSlot *slot = BMO_slot_get(op, slotname);
-       BMHeader **data =  slot->data.p;
+       BMElem **data =  slot->data.p;
        int i;
 
        BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
@@ -806,7 +806,7 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotnam
        }
 
        for (i = 0; i < slot->len; i++) {
-               if (!(htype & data[i]->htype))
+               if (!(htype & data[i]->head.htype))
                        continue;
 
                if (do_flush_select) {
@@ -827,7 +827,7 @@ void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotna
                                    const char hflag, const char htype, char do_flush_select)
 {
        BMOpSlot *slot = BMO_slot_get(op, slotname);
-       BMHeader **data =  slot->data.p;
+       BMElem **data =  slot->data.p;
        int i;
 
        BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
@@ -837,7 +837,7 @@ void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotna
        }
 
        for (i = 0; i < slot->len; i++) {
-               if (!(htype & data[i]->htype))
+               if (!(htype & data[i]->head.htype))
                        continue;
 
                if (do_flush_select) {
index 2f47104476b2a44df08064d65fa6e5419137dd8e..b5807f9ba8df15138300de1e599a290b27398ad2 100644 (file)
@@ -331,13 +331,13 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
                if (me->mselect) {
                        for (i = 0; i < me->totselect; i++) {
                                if (me->mselect[i].type == ME_VSEL) {
-                                       BM_select_history_store(bm, vertex_array[me->mselect[i].index]);
+                                       BM_select_history_store(bm, (BMElem *)vertex_array[me->mselect[i].index]);
                                }
                                else if (me->mselect[i].type == ME_ESEL) {
-                                       BM_select_history_store(bm, edge_array[me->mselect[i].index]);
+                                       BM_select_history_store(bm, (BMElem *)edge_array[me->mselect[i].index]);
                                }
                                else if (me->mselect[i].type == ME_FSEL) {
-                                       BM_select_history_store(bm, face_array[me->mselect[i].index]);
+                                       BM_select_history_store(bm, (BMElem *)face_array[me->mselect[i].index]);
                                }
                        }
                }
@@ -674,7 +674,7 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
                                me->mselect[i].type = ME_FSEL;
                        }
 
-                       me->mselect[i].index = BM_elem_index_get(selected->data);
+                       me->mselect[i].index = BM_elem_index_get(selected->ele);
                }
        }
 
index ec64caa82539beb6fb9ec9180e0c06fca875a614..1bc1ebcd9a7930125916688003fc2a29c83c2e28 100644 (file)
@@ -889,18 +889,18 @@ void MESH_OT_select_similar(wmOperatorType *ot)
 static void walker_select(BMEditMesh *em, int walkercode, void *start, int select)
 {
        BMesh *bm = em->bm;
-       BMHeader *h;
+       BMElem *ele;
        BMWalker walker;
 
        BMW_init(&walker, bm, walkercode,
                 BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
                 BMW_NIL_LAY);
-       h = BMW_begin(&walker, start);
-       for ( ; h; h = BMW_step(&walker)) {
+       ele = BMW_begin(&walker, start);
+       for ( ; ele; ele = BMW_step(&walker)) {
                if (!select) {
-                       BM_select_history_remove(bm, h);
+                       BM_select_history_remove(bm, ele);
                }
-               BM_elem_select_set(bm, h, select);
+               BM_elem_select_set(bm, ele, select);
        }
        BMW_end(&walker);
 }
@@ -1369,7 +1369,7 @@ static void mouse_mesh_shortest_path(bContext *C, int mval[2])
                        
                        if (ese && ese->htype == BM_EDGE) {
                                BMEdge *e_act;
-                               e_act = (BMEdge *)ese->data;
+                               e_act = (BMEdge *)ese->ele;
                                if (e_act != e) {
                                        if (edgetag_shortest_path(vc.scene, em, e_act, e)) {
                                                EDBM_remove_selection(em, e_act);
@@ -1999,7 +1999,7 @@ void MESH_OT_select_less(wmOperatorType *ot)
    are reached is not a multiple of "nth". */
 static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h_act)
 {
-       BMHeader *h;
+       BMElem *ele;
        BMesh *bm = em->bm;
        BMWalker walker;
        BMIter iter;
@@ -2037,10 +2037,10 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
        /* Walker restrictions uses BMO flags, not header flags,
         * 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_elem_flag_test(h, BM_ELEM_SELECT)) {
+       BM_ITER(ele, &iter, bm, itertype, NULL) {
+               if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
                        /* BMESH_TODO, don't use 'BM_ELEM_SELECT' here, its a HFLAG only! */
-                       BMO_elem_flag_enable(bm, (BMElemF *)h, BM_ELEM_SELECT);
+                       BMO_elem_flag_enable(bm, (BMElemF *)ele, BM_ELEM_SELECT);
                }
        }
 
@@ -2050,10 +2050,10 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
                 BMW_NIL_LAY);
 
        BLI_assert(walker.order == BMW_BREADTH_FIRST);
-       for (h = BMW_begin(&walker, h_act); h != NULL; h = BMW_step(&walker)) {
+       for (ele = BMW_begin(&walker, h_act); ele != NULL; ele = BMW_step(&walker)) {
                /* Deselect elements that aren't at "nth" depth from active */
                if ((offset + BMW_current_depth(&walker)) % nth) {
-                       BM_elem_select_set(bm, h, FALSE);
+                       BM_elem_select_set(bm, ele, FALSE);
                }
        }
        BMW_end(&walker);
@@ -2082,13 +2082,13 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **v_p, BMEdge **e_p, BMFa
        if (ese) {
                switch(ese->htype) {
                case BM_VERT:
-                       *v_p = (BMVert *)ese->data;
+                       *v_p = (BMVert *)ese->ele;
                        return;
                case BM_EDGE:
-                       *e_p = (BMEdge *)ese->data;
+                       *e_p = (BMEdge *)ese->ele;
                        return;
                case BM_FACE:
-                       *f_p = (BMFace *)ese->data;
+                       *f_p = (BMFace *)ese->ele;
                        return;
                }
        }
@@ -2356,13 +2356,13 @@ static int select_non_manifold_exec(bContext *C, wmOperator *op)
        }
        
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (!BM_elem_flag_test(em->bm, BM_ELEM_HIDDEN) && !BM_vert_is_manifold(em->bm, v)) {
+               if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN) && !BM_vert_is_manifold(em->bm, v)) {
                        BM_elem_select_set(em->bm, v, TRUE);
                }
        }
        
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (!BM_elem_flag_test(em->bm, BM_ELEM_HIDDEN) && BM_edge_face_count(e) != 2) {
+               if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && BM_edge_face_count(e) != 2) {
                        BM_elem_select_set(em->bm, e, TRUE);
                }
        }
index ed3bd0c8a8770579f659dd0c9149c8076057ac9f..f0c00d0ff0779108da60aba4e3170e3aa4f48fa0 100644 (file)
@@ -53,14 +53,14 @@ void EDBM_editselection_plane(BMEditMesh *em, float *plane, BMEditSelection *ese
        BM_editselection_plane(em->bm, plane, ese);
 }
 
-void EDBM_remove_selection(BMEditMesh *em, void *data)
+void EDBM_remove_selection(BMEditMesh *em, BMElem *ele)
 {
-       BM_select_history_remove(em->bm, data);
+       BM_select_history_remove(em->bm, ele);
 }
 
-void EDBM_store_selection(BMEditMesh *em, void *data)
+void EDBM_store_selection(BMEditMesh *em, BMElem *ele)
 {
-       BM_select_history_store(em->bm, data);
+       BM_select_history_store(em->bm, ele);
 }
 
 void EDBM_validate_selections(BMEditMesh *em)
index 91aaa36c77d5a935b8ae50435046c7a0a4972ae7..74ef159b40e3458eb21d0650db78541214d08248 100644 (file)
@@ -1424,7 +1424,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot)
 void EDBM_hide_mesh(BMEditMesh *em, int swap)
 {
        BMIter iter;
-       BMHeader *h;
+       BMElem *ele;
        int itermode;
 
        if (em == NULL) return;
@@ -1436,9 +1436,9 @@ void EDBM_hide_mesh(BMEditMesh *em, int swap)
        else
                itermode = BM_FACES_OF_MESH;
 
-       BM_ITER(h, &iter, em->bm, itermode, NULL) {
-               if (BM_elem_flag_test(h, BM_ELEM_SELECT) ^ swap)
-                       BM_elem_hide_set(em->bm, h, TRUE);
+       BM_ITER(ele, &iter, em->bm, itermode, NULL) {
+               if (BM_elem_flag_test(ele, BM_ELEM_SELECT) ^ swap)
+                       BM_elem_hide_set(em->bm, ele, TRUE);
        }
 
        EDBM_selectmode_flush(em);
@@ -1497,7 +1497,7 @@ void EDBM_reveal_mesh(BMEditMesh *em)
                      };
 
        BMIter iter;
-    BMHeader *ele;
+    BMElem *ele;
        int i;
 
        /* Use tag flag to remember what was hidden before all is revealed.
@@ -2011,11 +2011,11 @@ static int merge_firstlast(BMEditMesh *em, int first, int uvmerge, wmOperator *w
        /* do sanity check in mergemenu in edit.c ?*/
        if (first == 0) {
                ese = em->bm->selected.last;
-               mergevert = (BMVert *)ese->data;
+               mergevert = (BMVert *)ese->ele;
        }
        else{
                ese = em->bm->selected.first;
-               mergevert = (BMVert *)ese->data;
+               mergevert = (BMVert *)ese->ele;
        }
 
        if (!BM_elem_flag_test(mergevert, BM_ELEM_SELECT))
@@ -2270,7 +2270,7 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
 
        /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
-       EDBM_InitOpf(em, &bmop, op, "vertexshortestpath startv=%e endv=%e type=%i", sv->data, ev->data, type);
+       EDBM_InitOpf(em, &bmop, op, "vertexshortestpath startv=%e endv=%e type=%i", sv->ele, ev->ele, type);
 
        /* execute the operator */
        BMO_op_exec(em->bm, &bmop);
@@ -2739,7 +2739,7 @@ static int select_axis_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
        else {
-               BMVert *ev, *act_vert = (BMVert *)ese->data;
+               BMVert *ev, *act_vert = (BMVert *)ese->ele;
                BMIter iter;
                float value = act_vert->co[axis];
                float limit =  CTX_data_tool_settings(C)->doublimit; // XXX
index da1904cf11a5b3de89e83d1bdc8631c0c427621c..96ef8b98bf88cdedebedc0b7f5db9f6cbaf647ee 100644 (file)
@@ -83,7 +83,7 @@ void EDBM_stats_update(BMEditMesh *em)
                                    BM_FACES_OF_MESH};
 
        BMIter iter;
-       BMHeader *ele;
+       BMElem *ele;
        int *tots[3];
        int i;
 
@@ -451,24 +451,24 @@ int EDBM_get_actSelection(BMEditMesh *em, BMEditSelection *ese)
        if (ese_last) {
                if (ese_last->htype == BM_FACE) { /* if there is an active face, use it over the last selected face */
                        if (efa) {
-                               ese->data = (void *)efa;
+                               ese->ele = (BMElem *)efa;
                        }
                        else {
-                               ese->data = ese_last->data;
+                               ese->ele = ese_last->ele;
                        }
                        ese->htype = BM_FACE;
                }
                else {
-                       ese->data = ese_last->data;
+                       ese->ele =   ese_last->ele;
                        ese->htype = ese_last->htype;
                }
        }
        else if (efa) { /* no */
-               ese->data = (void *)efa;
+               ese->ele   = (BMElem *)efa;
                ese->htype = BM_FACE;
        }
        else {
-               ese->data = NULL;
+               ese->ele = NULL;
                return 0;
        }
        return 1;
index 15278233552929ecf561a898e8fadcdea6202ac8..88e145245a4ab2401a14899a8439bf9352a14bb3 100644 (file)
@@ -2986,10 +2986,10 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                        efa_act = (BMFace *)ese->data;
                }
                else */ if ( ese->htype == BM_EDGE ) {
-                       eed_act = (BMEdge *)ese->data;
+                       eed_act = (BMEdge *)ese->ele;
                }
                else if ( ese->htype == BM_VERT ) {
-                       eve_act = (BMVert *)ese->data;
+                       eve_act = (BMVert *)ese->ele;
                }
        }
        
index a61bc823e47eb84c231a3b41c17901845b70d7fe..3c4e3b6009c7464f7708f4533517da4cd8566fd5 100644 (file)
@@ -625,8 +625,8 @@ static void act_vert_def(Object *ob, BMVert **eve, MDeformVert **dvert)
                BMEditSelection *ese = (BMEditSelection *)em->bm->selected.last;
 
                if (ese && ese->htype == BM_VERT) {
-                       *eve= (BMVert *)ese->data;
-                       *dvert= CustomData_bmesh_get(&em->bm->vdata, (*eve)->head.data, CD_MDEFORMVERT);
+                       *eve = (BMVert *)ese->ele;
+                       *dvert = CustomData_bmesh_get(&em->bm->vdata, (*eve)->head.data, CD_MDEFORMVERT);
                        return;
                }
        }
index 67adac9bea2b93586391a891ca3daa60f238d632..63bc71e5330cae0e9cd1c626422404f1c28ebc92 100644 (file)
@@ -2113,7 +2113,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
        if (em->bm->selected.last) {
                BMEditSelection *ese = em->bm->selected.last;
                if (ese->htype == BM_VERT) {
-                       eve_act = (BMVert *)ese->data;
+                       eve_act = (BMVert *)ese->ele;
                }
        }
 
index 4366ea7ee086e460ca7dc6fa7ccc4991be48bdde..63871152af83c6e81d81a3705d00277a291d8c6b 100644 (file)
@@ -313,20 +313,20 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
                        BMOperator findop;
                        BMOIter oiter;
                        BMVert *v, *v2;
-                       BMHeader *h;
+                       BMElem *ele;
 
                        BMO_op_initf(em->bm, &findop,
                                     "finddoubles verts=%av dist=%f keepverts=%s",
                                     amd->merge_dist, &op, "geom");
 
                        i = 0;
-                       BMO_ITER(h, &oiter, em->bm, &op, "geom", BM_ALL) {
-                               BM_elem_index_set(h, i); /* set_dirty */
+                       BMO_ITER(ele, &oiter, em->bm, &op, "geom", BM_ALL) {
+                               BM_elem_index_set(ele, i); /* set_dirty */
                                i++;
                        }
 
-                       BMO_ITER(h, &oiter, em->bm, &op, "newout", BM_ALL) {
-                               BM_elem_index_set(h, i); /* set_dirty */
+                       BMO_ITER(ele, &oiter, em->bm, &op, "newout", BM_ALL) {
+                               BM_elem_index_set(ele, i); /* set_dirty */
                                i++;
                        }
                        /* above loops over all, so set all to dirty, if this is somehow
index 6d6bb0db0f6915119cd9188bb07d41f67ef9aaf6..c4b5d70d83f3254c1bacc5194278c1a3af830a24 100644 (file)
@@ -164,8 +164,8 @@ static int bpy_bm_elem_index_set(BPy_BMElem *self, PyObject *value, void *UNUSED
                BM_elem_index_set(self->ele, param); /* set_dirty! */
 
                /* when setting the index assume its set invalid */
-               if (self->ele->htype & (BM_VERT | BM_EDGE | BM_FACE)) {
-                       self->bm->elem_index_dirty |= self->ele->htype;
+               if (self->ele->head.htype & (BM_VERT | BM_EDGE | BM_FACE)) {
+                       self->bm->elem_index_dirty |= self->ele->head.htype;
                }
 
                return 0;
@@ -1500,7 +1500,7 @@ static PyObject *bpy_bmelemseq_index_update(BPy_BMElemSeq *self)
                default:
                {
                        BMIter iter;
-                       BMHeader *ele;
+                       BMElem *ele;
                        int index = 0;
                        const char htype = bm_iter_itype_htype_map[self->itype];
 
@@ -1790,7 +1790,7 @@ static int bpy_bmelemseq_contains(BPy_BMElemSeq *self, PyObject *value)
        if (Py_TYPE(value) == bpy_bm_itype_as_pytype(self->itype)) {
                BPy_BMElem *value_bm_ele = (BPy_BMElem *)value;
                if (value_bm_ele->bm == self->bm) {
-                       BMHeader *ele, *ele_test = value_bm_ele->ele;
+                       BMElem *ele, *ele_test = value_bm_ele->ele;
                        BMIter iter;
                        BM_ITER_BPY_BM_SEQ(ele, &iter, self) {
                                if (ele == ele_test) {
@@ -1870,7 +1870,7 @@ static void bpy_bmvert_dealloc(BPy_BMElem *self)
 {
        BMesh *bm = self->bm;
        if (bm) {
-               void **ptr = CustomData_bmesh_get(&bm->vdata, self->ele->data, CD_BM_ELEM_PYPTR);
+               void **ptr = CustomData_bmesh_get(&bm->vdata, self->ele->head.data, CD_BM_ELEM_PYPTR);
                *ptr = NULL;
        }
        PyObject_DEL(self);
@@ -1880,7 +1880,7 @@ static void bpy_bmedge_dealloc(BPy_BMElem *self)
 {
        BMesh *bm = self->bm;
        if (bm) {
-               void **ptr = CustomData_bmesh_get(&bm->edata, self->ele->data, CD_BM_ELEM_PYPTR);
+               void **ptr = CustomData_bmesh_get(&bm->edata, self->ele->head.data, CD_BM_ELEM_PYPTR);
                *ptr = NULL;
        }
        PyObject_DEL(self);
@@ -1890,7 +1890,7 @@ static void bpy_bmface_dealloc(BPy_BMElem *self)
 {
        BMesh *bm = self->bm;
        if (bm) {
-               void **ptr = CustomData_bmesh_get(&bm->pdata, self->ele->data, CD_BM_ELEM_PYPTR);
+               void **ptr = CustomData_bmesh_get(&bm->pdata, self->ele->head.data, CD_BM_ELEM_PYPTR);
                *ptr = NULL;
        }
        PyObject_DEL(self);
@@ -1900,7 +1900,7 @@ static void bpy_bmloop_dealloc(BPy_BMElem *self)
 {
        BMesh *bm = self->bm;
        if (bm) {
-               void **ptr = CustomData_bmesh_get(&bm->ldata, self->ele->data, CD_BM_ELEM_PYPTR);
+               void **ptr = CustomData_bmesh_get(&bm->ldata, self->ele->head.data, CD_BM_ELEM_PYPTR);
                *ptr = NULL;
        }
        PyObject_DEL(self);
@@ -2304,7 +2304,7 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_
                Py_ssize_t i;
 
                BPy_BMElem *item;
-               BMHeader **alloc;
+               BMElem **alloc;
 
                seq_len = PySequence_Fast_GET_SIZE(seq_fast);
 
index 05a36ee9897e8645110a63af2e62ea698caaa1e0..c928e8866c34ce8d6b669483fb45f96dcb1c529a 100644 (file)
@@ -56,7 +56,7 @@ typedef struct BPy_BMGeneric {
 typedef struct BPy_BMElem {
        PyObject_VAR_HEAD
        struct BMesh *bm; /* keep first */
-       struct BMHeader *ele;
+       struct BMElem *ele;
 } BPy_BMElem;
 
 typedef struct BPy_BMesh {