Fix #29558: Selecting similar edges doesn't work
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 9 Dec 2011 16:10:15 +0000 (16:10 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 9 Dec 2011 16:10:15 +0000 (16:10 +0000)
Return OPERATOR_FINISHED from select grouped operator in any case so
even if nothing were selected operator would be registered in redo panel
and threshold can be adjusted there.

source/blender/editors/mesh/editmesh_mods.c

index 0d268f8f4c147f37fb0c4bf87e86e55d16e95c78..a6e6a0410903e0dd32e1457a08944e295198a3a8 100644 (file)
@@ -873,12 +873,10 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
                /* here was an edge-mode only select flush case, has to be generalized */
                EM_selectmode_flush(em);
                WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
-               BKE_mesh_end_editmesh(me, em);
-               return OPERATOR_FINISHED;
        }
        
        BKE_mesh_end_editmesh(me, em);
-       return OPERATOR_CANCELLED;
+       return OPERATOR_FINISHED;
 }      
 
 /* ***************************************************** */
@@ -1092,12 +1090,10 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
                /* here was an edge-mode only select flush case, has to be generalized */
                EM_selectmode_flush(em);
                WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
-               BKE_mesh_end_editmesh(me, em);
-               return OPERATOR_FINISHED;
        }
-       
+
        BKE_mesh_end_editmesh(me, em);
-       return OPERATOR_CANCELLED;
+       return OPERATOR_FINISHED;
 }
 
 /* ********************************* */
@@ -1135,7 +1131,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
        
        if (!ok || !deselcount) { /* no data selected OR no more data to select*/
                BKE_mesh_end_editmesh(me, em);
-               return 0;
+               return OPERATOR_CANCELLED;
        }
        
        if(mode == SIMVERT_FACE) {
@@ -1230,12 +1226,10 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
 
        if(selcount) {
                WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
-               BKE_mesh_end_editmesh(me, em);
-               return OPERATOR_FINISHED;
        }
 
        BKE_mesh_end_editmesh(me, em);
-       return OPERATOR_CANCELLED;
+       return OPERATOR_FINISHED;
 }
 
 static int select_similar_exec(bContext *C, wmOperator *op)