Fix T63247: edbm_rip_invoke__edge rips unselected verts on mesh borders
authorSebastian Parborg <darkdefende@gmail.com>
Wed, 17 Apr 2019 10:30:00 +0000 (12:30 +0200)
committerSebastian Parborg <darkdefende@gmail.com>
Wed, 17 Apr 2019 10:33:33 +0000 (12:33 +0200)
Ripping edges would in some cases rip verts on unselected edges. This is now fixed so that we only rip verts from the actually selected edges.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D4646

source/blender/bmesh/tools/bmesh_edgesplit.c
source/blender/editors/mesh/editmesh_rip.c

index 332672d..388e7f4 100644 (file)
@@ -78,11 +78,12 @@ void BM_mesh_edgesplit(BMesh *bm,
       }
     }
   }
-
-  BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
-    if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
-      BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
-      BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
+  else {
+    BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
+      if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
+        BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
+        BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
+      }
     }
   }
 
index a341b51..b1a62ff 100644 (file)
@@ -904,6 +904,9 @@ static int edbm_rip_invoke__edge(bContext *C, const wmEvent *event, Object *obed
         if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
           e_best = e;
           i++;
+          /* Tag the edge verts so we know which verts to rip */
+          BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
+          BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
         }
         totedge_manifold++;
       }