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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 0ea807586f9..5a0a2b7a09a 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -2016,6 +2016,7 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op)
uint objects_len = 0;
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
view_layer, CTX_wm_view3d(C), &objects_len);
+ bool changed = false;
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
@@ -2026,6 +2027,7 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op)
BMOperator bmop;
BMesh *bm = em->bm;
+ changed = true;
EDBM_op_init(em,
&bmop,
@@ -2060,16 +2062,16 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op)
}
MEM_freeN(objects);
- return OPERATOR_FINISHED;
+ return (changed) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
static int edbm_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
WM_cursor_wait(true);
- edbm_duplicate_exec(C, op);
+ const int retval = edbm_duplicate_exec(C, op);
WM_cursor_wait(false);
- return OPERATOR_FINISHED;
+ return retval;
}
void MESH_OT_duplicate(wmOperatorType *ot)