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:
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 13660a47248..f05df06ffa2 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -862,7 +862,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
copy_v3_v3(min, cent);
mul_m4_v3(vc.obedit->obmat, min); /* view space */
- view3d_get_view_aligned_coordinate(vc.ar, min, event->mval, true);
+ ED_view3d_win_to_3d_int(vc.ar, min, event->mval, min);
mul_m4_v3(vc.obedit->imat, min); // back in object space
sub_v3_v3(min, cent);
@@ -911,7 +911,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
BMOIter oiter;
copy_v3_v3(min, curs);
- view3d_get_view_aligned_coordinate(vc.ar, min, event->mval, false);
+ ED_view3d_win_to_3d_int(vc.ar, min, event->mval, min);
invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
mul_m4_v3(vc.obedit->imat, min); // back in object space
@@ -1238,6 +1238,8 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BMEdit_FromObject(obedit);
const short use_smooth = edbm_add_edge_face__smooth_get(em->bm);
+ const int totedge_orig = em->bm->totedge;
+ const int totface_orig = em->bm->totface;
/* when this is used to dissolve we could avoid this, but checking isnt too slow */
#ifdef USE_FACE_CREATE_SEL_EXTEND
@@ -1258,6 +1260,14 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
BMO_op_exec(em->bm, &bmop);
+ /* cancel if nothing was done */
+ if ((totedge_orig == em->bm->totedge) &&
+ (totface_orig == em->bm->totface))
+ {
+ EDBM_op_finish(em, &bmop, op, true);
+ return OPERATOR_CANCELLED;
+ }
+
#ifdef USE_FACE_CREATE_SEL_EXTEND
/* normally we would want to leave the new geometry selected,
* but being able to press F many times to add geometry is too useful! */
@@ -1279,7 +1289,7 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
}
EDBM_update_generic(em, true, true);
-
+
return OPERATOR_FINISHED;
}