Fix T37583: regression in bmesh triangulate breaking python's use of face_map
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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__ */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user