forked from bartvdbraak/blender
BMesh: use BM_face_loop_separate_multi for rip
Resolves bug over-splitting non-manifold connected edges.
This commit is contained in:
parent
3ef27ec807
commit
99811c283e
@ -734,20 +734,42 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
||||
/* unlike edge split, for single vertex split we only use the operator in one of the cases
|
||||
* but both allocate fill */
|
||||
|
||||
/* rip two adjacent edges */
|
||||
if (BM_edge_is_boundary(e2) || BM_vert_face_count_is_equal(v, 2)) {
|
||||
/* Don't run the edge split operator in this case */
|
||||
{
|
||||
BMVert *v_rip;
|
||||
BMLoop *larr[2];
|
||||
int larr_len = 0;
|
||||
|
||||
l = BM_edge_vert_share_loop(e2->l, v);
|
||||
/* rip two adjacent edges */
|
||||
if (BM_edge_is_boundary(e2) || BM_vert_face_count_is_equal(v, 2)) {
|
||||
/* Don't run the edge split operator in this case */
|
||||
|
||||
/* only tag for face-fill (we don't call the operator) */
|
||||
if (BM_edge_is_boundary(e2)) {
|
||||
BM_elem_flag_enable(e2, BM_ELEM_TAG);
|
||||
l = BM_edge_vert_share_loop(e2->l, v);
|
||||
larr[larr_len] = l;
|
||||
larr_len++;
|
||||
|
||||
/* only tag for face-fill (we don't call the operator) */
|
||||
if (BM_edge_is_boundary(e2)) {
|
||||
BM_elem_flag_enable(e2, BM_ELEM_TAG);
|
||||
}
|
||||
else {
|
||||
BM_elem_flag_enable(l->e, BM_ELEM_TAG);
|
||||
BM_elem_flag_enable(l->prev->e, BM_ELEM_TAG);
|
||||
}
|
||||
}
|
||||
else {
|
||||
BM_elem_flag_enable(l->e, BM_ELEM_TAG);
|
||||
BM_elem_flag_enable(l->prev->e, BM_ELEM_TAG);
|
||||
if (BM_edge_is_manifold(e2)) {
|
||||
BMLoop *l_iter, *l_first;
|
||||
|
||||
l_iter = l_first = e2->l;
|
||||
do {
|
||||
larr[larr_len] = BM_edge_vert_share_loop(l_iter, v);
|
||||
BM_elem_flag_enable(larr[larr_len]->e, BM_ELEM_TAG);
|
||||
larr_len++;
|
||||
} while ((l_iter = l_iter->radial_next) != l_first);
|
||||
}
|
||||
else {
|
||||
/* looks like there are no split edges, we could just return/report-error? - Campbell */
|
||||
}
|
||||
}
|
||||
|
||||
/* keep directly before edgesplit */
|
||||
@ -755,13 +777,12 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
||||
fill_uloop_pairs = edbm_tagged_loop_pairs_to_fill(bm);
|
||||
}
|
||||
|
||||
#if 0
|
||||
v_rip = BM_face_vert_separate(bm, l->f, v);
|
||||
#else
|
||||
v_rip = BM_face_loop_separate(bm, l);
|
||||
#endif
|
||||
|
||||
BLI_assert(v_rip);
|
||||
if (larr_len) {
|
||||
v_rip = BM_face_loop_separate_multi(bm, larr, larr_len);
|
||||
}
|
||||
else {
|
||||
v_rip = NULL;
|
||||
}
|
||||
|
||||
if (v_rip) {
|
||||
BM_vert_select_set(bm, v_rip, true);
|
||||
@ -771,27 +792,6 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (BM_edge_is_manifold(e2)) {
|
||||
l = e2->l;
|
||||
e = BM_loop_other_edge_loop(l, v)->e;
|
||||
BM_elem_flag_enable(e, BM_ELEM_TAG);
|
||||
|
||||
l = e2->l->radial_next;
|
||||
e = BM_loop_other_edge_loop(l, v)->e;
|
||||
BM_elem_flag_enable(e, BM_ELEM_TAG);
|
||||
}
|
||||
else {
|
||||
/* looks like there are no split edges, we could just return/report-error? - Campbell */
|
||||
}
|
||||
|
||||
/* keep directly before edgesplit */
|
||||
if (do_fill) {
|
||||
fill_uloop_pairs = edbm_tagged_loop_pairs_to_fill(bm);
|
||||
}
|
||||
|
||||
BM_mesh_edgesplit(em->bm, true, true, true);
|
||||
}
|
||||
|
||||
{
|
||||
/* --- select which vert --- */
|
||||
|
Loading…
Reference in New Issue
Block a user