diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-04-05 19:47:10 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-04-05 19:47:10 +0300 |
commit | 7748dd4ec735535f53f61d6aa4a2f6b9db9abdc1 (patch) | |
tree | 65f854f448a2503bef50781212355b74fa616839 /source/blender/editors/mesh/editmesh_tools.c | |
parent | 9e12a731db6f6647d5e6dfdaa32fc4d8117a523d (diff) | |
parent | b84255f590c07b129f726eadbfec72c73bfc2ee1 (diff) |
Merge remote-tracking branch 'origin/master' into temp-sculpt-colorstemp-sculpt-colors
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 8 |
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) |