From 5cdb2aadfcc7906050e163c48e88a005cfd42089 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Tue, 28 Sep 2021 16:53:24 -0300 Subject: Fix flag wrongly set in 'BM_face_split_edgenet_connect_islands' Sometimes the `use_partial_connect` option could trigger the assert: ``` BLI_assert(!BM_elem_flag_test(l_iter->v, VERT_NOT_IN_STACK)); ``` This can happen when `v_delimit->e` is not part of edgenet, so `v_other` will not have the flag. --- source/blender/bmesh/intern/bmesh_polygon_edgenet.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/bmesh/intern') diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c index 86a7d8153f0..3ce572077b8 100644 --- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c +++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c @@ -1135,11 +1135,13 @@ static BMVert *bm_face_split_edgenet_partial_connect(BMesh *bm, BMVert *v_delimi BMVert *v_other = BM_edge_other_vert(e_face_init ? e_face_init : v_delimit->e, v_delimit); BLI_SMALLSTACK_PUSH(search, v_other); - BM_elem_flag_disable(v_other, VERT_NOT_IN_STACK); + if (BM_elem_flag_test(v_other, VERT_NOT_IN_STACK)) { + BM_elem_flag_disable(v_other, VERT_NOT_IN_STACK); + BLI_linklist_prepend_alloca(&vert_stack, v_other); + } while ((v_other = BLI_SMALLSTACK_POP(search))) { BLI_assert(BM_elem_flag_test(v_other, VERT_NOT_IN_STACK) == false); - BLI_linklist_prepend_alloca(&vert_stack, v_other); BMEdge *e_iter = v_other->e; do { BMVert *v_step = BM_edge_other_vert(e_iter, v_other); @@ -1147,6 +1149,7 @@ static BMVert *bm_face_split_edgenet_partial_connect(BMesh *bm, BMVert *v_delimi if (BM_elem_flag_test(v_step, VERT_NOT_IN_STACK)) { BM_elem_flag_disable(v_step, VERT_NOT_IN_STACK); BLI_SMALLSTACK_PUSH(search, v_step); + BLI_linklist_prepend_alloca(&vert_stack, v_other); } } } while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, v_other)) != v_other->e); -- cgit v1.2.3