diff options
author | Pratik Borhade <PratikPB2123> | 2022-04-05 13:13:03 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-04-05 13:30:00 +0300 |
commit | d00de988c36a6bde9bccdd75cd544085df2d472c (patch) | |
tree | 1b3f13b45d75da53c014549334baf463df6aa7d4 /source/blender/editors/gpencil | |
parent | d88b821d285e275240ad9ec52921e409cb6a5d52 (diff) |
WM: avoid unnecessary undo step creation when duplicating
Calling duplicate operation without selecting anything registers an undo
step. If nothing is selected (keyframe, curve, object, etc.), cancel the
operator execution to prevent undo push.
Patch improves following operators:
- ACTION_OT_duplicate
- GPENCIL_OT_duplicate
- GRAPH_OT_duplicate
- MESH_OT_duplicate
- NODE_OT_duplicate
- OBJECT_OT_duplicate
Reviewed By: campbellbarton
Ref D14511
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index a8fb344f366..3c8e6d6e5f5 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -994,9 +994,10 @@ static int gpencil_duplicate_exec(bContext *C, wmOperator *op) /* updates */ DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); + return OPERATOR_FINISHED; } - return OPERATOR_FINISHED; + return OPERATOR_CANCELLED; } void GPENCIL_OT_duplicate(wmOperatorType *ot) |