[Bf-blender-cvs] [5cdb2aadfcc] master: Fix flag wrongly set in 'BM_face_split_edgenet_connect_islands'

Germano Cavalcante noreply at git.blender.org
Tue Sep 28 21:54:41 CEST 2021


Commit: 5cdb2aadfcc7906050e163c48e88a005cfd42089
Author: Germano Cavalcante
Date:   Tue Sep 28 16:53:24 2021 -0300
Branches: master
https://developer.blender.org/rB5cdb2aadfcc7906050e163c48e88a005cfd42089

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.

===================================================================

M	source/blender/bmesh/intern/bmesh_polygon_edgenet.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list