Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-13 05:00:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-13 05:00:07 +0400
commit49411a6e37ce88e644db733621ac2577851a7b7e (patch)
tree1c8b40d96f40d1e991694ce227d6e7572b620422 /source/blender/bmesh
parentfd14c344e0b1160ab17243297a86521d73256b8b (diff)
fix own regression, rip tool wasn't handling selection.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_core.c23
-rw-r--r--source/blender/bmesh/intern/bmesh_core.h6
-rw-r--r--source/blender/bmesh/operators/bmo_inset.c4
-rw-r--r--source/blender/bmesh/operators/bmo_split_edges.c2
-rw-r--r--source/blender/bmesh/tools/bmesh_edgesplit.c8
-rw-r--r--source/blender/bmesh/tools/bmesh_edgesplit.h2
6 files changed, 28 insertions, 17 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c
index 51461190233..b296c367575 100644
--- a/source/blender/bmesh/intern/bmesh_core.c
+++ b/source/blender/bmesh/intern/bmesh_core.c
@@ -1915,7 +1915,8 @@ bool BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target)
*
* \return Success
*/
-void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len)
+void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
+ const bool copy_select)
{
const int v_edgetot = BM_vert_face_count(v);
BMEdge **stack = BLI_array_alloca(stack, v_edgetot);
@@ -1970,6 +1971,9 @@ void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len
verts[0] = v;
for (i = 1; i < maxindex; i++) {
verts[i] = BM_vert_create(bm, v->co, v, 0);
+ if (copy_select) {
+ BM_elem_select_copy(bm, bm, verts[i], v);
+ }
}
/* Replace v with the new verts in each group */
@@ -2052,11 +2056,11 @@ void BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
for (i = 0; i < e_in_len; i++) {
BMEdge *e = e_in[i];
if (e->l && BM_vert_in_edge(e, v)) {
- bmesh_edge_separate(bm, e, e->l);
+ bmesh_edge_separate(bm, e, e->l, false);
}
}
- bmesh_vert_separate(bm, v, r_vout, r_vout_len);
+ bmesh_vert_separate(bm, v, r_vout, r_vout_len, false);
}
/**
@@ -2112,7 +2116,8 @@ bool BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target)
* \note Does nothing if \a l_sep is already the only loop in the
* edge radial.
*/
-void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
+void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep,
+ const bool copy_select)
{
BMEdge *e_new;
#ifndef NDEBUG
@@ -2136,6 +2141,10 @@ void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
bmesh_radial_append(e_new, l_sep);
l_sep->e = e_new;
+ if (copy_select) {
+ BM_elem_select_copy(bm, bm, e_new, e);
+ }
+
BLI_assert(bmesh_radial_length(e->l) == radlen - 1);
BLI_assert(bmesh_radial_length(e_new->l) == 1);
@@ -2159,8 +2168,8 @@ BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep)
/* peel the face from the edge radials on both sides of the
* loop vert, disconnecting the face from its fan */
- bmesh_edge_separate(bm, l_sep->e, l_sep);
- bmesh_edge_separate(bm, l_sep->prev->e, l_sep->prev);
+ bmesh_edge_separate(bm, l_sep->e, l_sep, false);
+ bmesh_edge_separate(bm, l_sep->prev->e, l_sep->prev, false);
if (bmesh_disk_count(v_sep) == 2) {
/* If there are still only two edges out of v_sep, then
@@ -2178,7 +2187,7 @@ BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep)
/* Split all fans connected to the vert, duplicating it for
* each fans. */
- bmesh_vert_separate(bm, v_sep, &vtar, &len);
+ bmesh_vert_separate(bm, v_sep, &vtar, &len, false);
/* There should have been at least two fans cut apart here,
* otherwise the early exit would have kicked in. */
diff --git a/source/blender/bmesh/intern/bmesh_core.h b/source/blender/bmesh/intern/bmesh_core.h
index ea25a5c3ee7..c9e806335dd 100644
--- a/source/blender/bmesh/intern/bmesh_core.h
+++ b/source/blender/bmesh/intern/bmesh_core.h
@@ -50,11 +50,13 @@ void BM_face_kill(BMesh *bm, BMFace *f);
void BM_edge_kill(BMesh *bm, BMEdge *e);
void BM_vert_kill(BMesh *bm, BMVert *v);
-void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep);
+void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep,
+ const bool copy_select);
bool BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target);
bool BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target);
-void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len);
+void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
+ const bool copy_select);
bool bmesh_loop_reverse(BMesh *bm, BMFace *f);
diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c
index 60fdf075d18..a7b98cda2b3 100644
--- a/source/blender/bmesh/operators/bmo_inset.c
+++ b/source/blender/bmesh/operators/bmo_inset.c
@@ -457,7 +457,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
/* run the separate arg */
- bmesh_edge_separate(bm, es->e_old, es->l);
+ bmesh_edge_separate(bm, es->e_old, es->l, false);
/* calc edge-split info */
es->e_new = es->l->e;
@@ -535,7 +535,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
/* disable touching twice, this _will_ happen if the flags not disabled */
BM_elem_flag_disable(v, BM_ELEM_TAG);
- bmesh_vert_separate(bm, v, &vout, &r_vout_len);
+ bmesh_vert_separate(bm, v, &vout, &r_vout_len, false);
v = NULL; /* don't use again */
/* in some cases the edge doesn't split off */
diff --git a/source/blender/bmesh/operators/bmo_split_edges.c b/source/blender/bmesh/operators/bmo_split_edges.c
index c0847930422..88c1c3dca44 100644
--- a/source/blender/bmesh/operators/bmo_split_edges.c
+++ b/source/blender/bmesh/operators/bmo_split_edges.c
@@ -48,7 +48,7 @@ void bmo_split_edges_exec(BMesh *bm, BMOperator *op)
}
/* this is where everything happens */
- BM_mesh_edgesplit(bm, use_verts, true);
+ BM_mesh_edgesplit(bm, use_verts, true, false);
BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_INTERNAL_TAG);
}
diff --git a/source/blender/bmesh/tools/bmesh_edgesplit.c b/source/blender/bmesh/tools/bmesh_edgesplit.c
index 3ae5c712f0a..adcf325b51c 100644
--- a/source/blender/bmesh/tools/bmesh_edgesplit.c
+++ b/source/blender/bmesh/tools/bmesh_edgesplit.c
@@ -98,7 +98,7 @@ static void bm_edgesplit_validate_seams(BMesh *bm)
MEM_freeN(vtouch);
}
-void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only)
+void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only, const bool copy_select)
{
BMIter iter;
BMEdge *e;
@@ -136,7 +136,7 @@ void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only)
/* keep splitting until each loop has its own edge */
do {
- bmesh_edge_separate(bm, e, e->l);
+ bmesh_edge_separate(bm, e, e->l, copy_select);
} while (!BM_edge_is_boundary(e));
BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
@@ -159,11 +159,11 @@ void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only)
if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
if (BM_elem_flag_test(e->v1, BM_ELEM_TAG)) {
BM_elem_flag_disable(e->v1, BM_ELEM_TAG);
- bmesh_vert_separate(bm, e->v1, NULL, NULL);
+ bmesh_vert_separate(bm, e->v1, NULL, NULL, copy_select);
}
if (BM_elem_flag_test(e->v2, BM_ELEM_TAG)) {
BM_elem_flag_disable(e->v2, BM_ELEM_TAG);
- bmesh_vert_separate(bm, e->v2, NULL, NULL);
+ bmesh_vert_separate(bm, e->v2, NULL, NULL, copy_select);
}
}
}
diff --git a/source/blender/bmesh/tools/bmesh_edgesplit.h b/source/blender/bmesh/tools/bmesh_edgesplit.h
index 8c1231dd794..bd66f6a9e2f 100644
--- a/source/blender/bmesh/tools/bmesh_edgesplit.h
+++ b/source/blender/bmesh/tools/bmesh_edgesplit.h
@@ -27,6 +27,6 @@
* \ingroup bmesh
*/
-void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only);
+void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only, const bool copy_select);
#endif /* __BMESH_EDGESPLIT_H__ */