[Bf-blender-cvs] [6bc8a3f] master: BMesh: rip-tool can now split off isolated fans
Campbell Barton
noreply at git.blender.org
Sat May 2 22:19:03 CEST 2015
Commit: 6bc8a3f8d3b47c1b8be0ede8293334448ea6bf3f
Author: Campbell Barton
Date: Sun May 3 06:15:51 2015 +1000
Branches: master
https://developer.blender.org/rB6bc8a3f8d3b47c1b8be0ede8293334448ea6bf3f
BMesh: rip-tool can now split off isolated fans
Useful since there wasn't a good way to do this previously.
===================================================================
M source/blender/editors/mesh/editmesh_rip.c
===================================================================
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c
index e9fc12f..abd88ae 100644
--- a/source/blender/editors/mesh/editmesh_rip.c
+++ b/source/blender/editors/mesh/editmesh_rip.c
@@ -559,9 +559,10 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
}
}
- /* this should be impossible, but sanity checks are a good thing */
- if (!v)
+ /* (v == NULL) should be impossible */
+ if ((v == NULL) || (v->e == NULL)) {
return OPERATOR_CANCELLED;
+ }
is_wire = BM_vert_is_wire(v);
@@ -621,6 +622,32 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
}
}
+ if (e2) {
+ /* Try to split off a non-manifold fan (when we have multiple disconnected fans) */
+
+ /* note: we're lazy here and first split then check there are any faces remaining,
+ * this isn't good practice, however its less hassle then checking for multiple-disconnected regions */
+ BMLoop *l_sep = e2->l->v == v ? e2->l : e2->l->next;
+ BMVert *v_new;
+ BLI_assert(l_sep->v == v);
+ v_new = bmesh_urmv_loop_region(bm, l_sep);
+ if (BM_vert_find_first_loop(v)) {
+ BM_vert_select_set(bm, v, false);
+ BM_select_history_remove(bm, v);
+
+ BM_vert_select_set(bm, v_new, true);
+ if (ese.ele) {
+ BM_select_history_store(bm, v_new);
+ }
+
+ return OPERATOR_FINISHED;
+ }
+ else {
+ /* rewind */
+ BM_vert_splice(bm, v, v_new);
+ }
+ }
+
/* should we go ahead with edge rip or do we need to do special case, split off vertex?:
* split off vertex if...
* - we cant find an edge - this means we are ripping a faces vert that is connected to other
More information about the Bf-blender-cvs
mailing list