diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-27 01:08:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-27 01:11:34 +0400 |
commit | 3b24eaad9af8025cb38879cbc345f7debceba5a9 (patch) | |
tree | a5552dd7502eb1f6e8f9e8b8c4d6f0854f8f574c /source/blender | |
parent | 8a54336ff7cf8a0b3b3ec4ae353b65716924d313 (diff) |
Fix T37583: regression in bmesh triangulate breaking python's use of face_map
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 7 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.h | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.c | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 0726af4b641..a270830e469 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -2294,7 +2294,7 @@ BMVert *bmesh_urmv(BMesh *bm, BMFace *f_sep, BMVert *v_sep) * low level function so both face pointers remain intact but point to swapped data. * \note must be from the same bmesh. */ -void bmesh_face_swap_data(BMesh *bm, BMFace *f_a, BMFace *f_b) +void bmesh_face_swap_data(BMFace *f_a, BMFace *f_b) { BMLoop *l_iter, *l_first; @@ -2311,5 +2311,8 @@ void bmesh_face_swap_data(BMesh *bm, BMFace *f_a, BMFace *f_b) } while ((l_iter = l_iter->next) != l_first); SWAP(BMFace, (*f_a), (*f_b)); - bm->elem_index_dirty |= BM_FACE; + + /* swap back */ + SWAP(void *, f_a->head.data, f_b->head.data); + SWAP(int, f_a->head.index, f_b->head.index); } diff --git a/source/blender/bmesh/intern/bmesh_core.h b/source/blender/bmesh/intern/bmesh_core.h index 9e33509c2c8..e9fd4e650cb 100644 --- a/source/blender/bmesh/intern/bmesh_core.h +++ b/source/blender/bmesh/intern/bmesh_core.h @@ -87,6 +87,6 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e); BMVert *bmesh_urmv(BMesh *bm, BMFace *f_sep, BMVert *v_sep); BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep); -void bmesh_face_swap_data(BMesh *bm, BMFace *f_a, BMFace *f_b); +void bmesh_face_swap_data(BMFace *f_a, BMFace *f_b); #endif /* __BMESH_CORE_H__ */ diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index 3db6ba0e7c9..341143ef0c6 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -1011,7 +1011,7 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, if ((!use_beauty) || (!r_faces_new)) { /* we can't delete the real face, because some of the callers expect it to remain valid. * so swap data and delete the last created tri */ - bmesh_face_swap_data(bm, f, f_new); + bmesh_face_swap_data(f, f_new); BM_face_kill(bm, f_new); } @@ -1071,7 +1071,7 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, /* we can't delete the real face, because some of the callers expect it to remain valid. * so swap data and delete the last created tri */ - bmesh_face_swap_data(bm, f, f_new); + bmesh_face_swap_data(f, f_new); BM_face_kill(bm, f_new); } } |