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>2012-03-16 03:23:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-16 03:23:04 +0400
commitbed5ae53660f742546db3467b31f8f390c59942b (patch)
treef4eef222d05ebaf7deac0efccd0b9912c8026e10 /source/blender/bmesh/intern/bmesh_mods.c
parent91c1f9ee770d12694425714a3c5966b9693b2ba5 (diff)
*picky* fix for edge rotate
- Edge rotate would leave verts selected, this would give problems because those selections would leave edges that would try to rotate when run again. now de-select old verts on edge rotate. - Rotating into hidden verts gave odd results, now make sure hidden state is ok. - BMO_slot_buffer_hflag_disable / BMO_slot_buffer_hflag_enable now have flushing for the hide flag too.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mods.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index 72f6814dc89..5248276bae6 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -824,7 +824,7 @@ void BM_edge_rotate_calc(BMesh *bm, BMEdge *e, int ccw,
BM_edge_ordered_verts(e, &v1, &v2);
/* we could swap the verts _or_ the faces, swapping faces
- * gives more pradictable resuts since that way the next vert
+ * gives more predictable resuts since that way the next vert
* just sitches from face fa / fb */
if (ccw) {
SWAP(BMFace *, fa, fb);
@@ -1006,6 +1006,8 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_
BMLoop *l1, *l2;
BMFace *f;
BMEdge *e_new = NULL;
+ char f_hflag_prev_1;
+ char f_hflag_prev_2;
if (!BM_edge_rotate_check(bm, e)) {
return NULL;
@@ -1017,8 +1019,6 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_
v1 = l1->v;
v2 = l2->v;
-
-
/* --------------------------------------- */
/* Checking Code - make sure we can rotate */
@@ -1053,6 +1053,9 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_
* if splice if disabled, always add in a new edge even if theres one there. */
e_new = BM_edge_create(bm, v1, v2, e, (check_flag & BM_EDGEROT_CHECK_SPLICE)!=0);
+ f_hflag_prev_1 = l1->f->head.hflag;
+ f_hflag_prev_2 = l2->f->head.hflag;
+
/* don't delete the edge, manually remove the egde after so we can copy its attributes */
f = BM_faces_join_pair(bm, l1->f, l2->f, NULL);
@@ -1066,6 +1069,16 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_
if (!BM_face_split(bm, f, v1, v2, NULL, NULL, TRUE)) {
return NULL;
}
+ else {
+ /* we should reallty be able to know the faces some other way,
+ * rather then fetching them back from the edge, but this is predictable
+ * where using the return values from face split isnt. - campbell */
+ BMFace *fa, *fb;
+ if (BM_edge_face_pair(e_new, &fa, &fb)) {
+ fa->head.hflag = f_hflag_prev_1;
+ fb->head.hflag = f_hflag_prev_2;
+ }
+ }
return e_new;
}