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>2011-09-09 08:09:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-09 08:09:34 +0400
commit9ff0b732a2070813d1139957cdc53e113f603cd8 (patch)
tree32d93d40812f99c90bf89948dbc81273a29a594b /source/blender
parent7b637dc1670dcb1fd1749ab0136311054dabbf27 (diff)
fix [#28534] Rotate Edge Vertices selection mode.
de-select other verts when rotating an edge, providing the initial edge was not between 2 selected faces.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/mesh/bmesh_tools.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c
index 7f791e02f13..f66be3ac71b 100644
--- a/source/blender/editors/mesh/bmesh_tools.c
+++ b/source/blender/editors/mesh/bmesh_tools.c
@@ -1512,7 +1512,8 @@ static int edge_rotate_selected(bContext *C, wmOperator *op)
BMOperator bmop;
BMEdge *eed;
BMIter iter;
- int ccw = RNA_int_get(op->ptr, "direction") == 1; // direction == 2 when clockwise and ==1 for counter CW.
+ const int do_ccw = RNA_enum_get(op->ptr, "direction") == 1;
+ int do_deselect= FALSE; /* do we deselect */
if (!(em->bm->totfacesel == 2 || em->bm->totedgesel == 1)) {
BKE_report(op->reports, RPT_ERROR, "Select one edge or two adjacent faces");
@@ -1539,8 +1540,11 @@ static int edge_rotate_selected(bContext *C, wmOperator *op)
if (!eed) {
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if (BM_TestHFlag(eed, BM_SELECT) && !BM_TestHFlag(eed, BM_HIDDEN))
+ if (BM_TestHFlag(eed, BM_SELECT) && !BM_TestHFlag(eed, BM_HIDDEN)) {
+ /* de-select the edge before */
+ do_deselect = TRUE;
break;
+ }
}
}
@@ -1548,9 +1552,14 @@ static int edge_rotate_selected(bContext *C, wmOperator *op)
if (!eed)
return OPERATOR_CANCELLED;
- EDBM_InitOpf(em, &bmop, op, "edgerotate edges=%e ccw=%d", eed, ccw);
- BMO_Exec_Op(em->bm, &bmop);
+ EDBM_InitOpf(em, &bmop, op, "edgerotate edges=%e ccw=%d", eed, do_ccw);
+ /* avoid adding to the selection if we start off with only a selected edge,
+ * we could also just deselect the single edge easily but use the BMO api
+ * since it seems this is more 'correct' */
+ if(do_deselect) BMO_UnHeaderFlag_Buffer(em->bm, &bmop, "edges", BM_SELECT, BM_EDGE);
+
+ BMO_Exec_Op(em->bm, &bmop);
BMO_HeaderFlag_Buffer(em->bm, &bmop, "edgeout", BM_SELECT, BM_EDGE);
if (!EDBM_FinishOp(em, &bmop, op, 1))