diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-16 08:04:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-16 08:04:44 +0400 |
commit | 23626e0149f25f13855735bbb7f65121e0c40ca0 (patch) | |
tree | 2688b304463fee3a042496727032f6772d447642 /source/blender/editors/space_sequencer | |
parent | 43bd8c2b28d06953b64ed6d1e72cead9e42463a0 (diff) |
fix [#36444] view3d.viewnumpad operator should not animate
when running viewport operations with exec() rather then invoke(), perform the action immediately rather then using smoothview.
makes viewport operations usable from python scripts.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 955a9c78c56..d8b4824b528 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2155,12 +2155,13 @@ void SEQUENCER_OT_meta_separate(wmOperatorType *ot) } /* view_all operator */ -static int sequencer_view_all_exec(bContext *C, wmOperator *UNUSED(op)) +static int sequencer_view_all_exec(bContext *C, wmOperator *op) { ARegion *ar = CTX_wm_region(C); View2D *v2d = UI_view2d_fromcontext(C); + const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); - UI_view2d_smooth_view(C, ar, &v2d->tot); + UI_view2d_smooth_view(C, ar, &v2d->tot, smooth_viewtx); return OPERATOR_FINISHED; } @@ -2322,7 +2323,7 @@ void SEQUENCER_OT_view_toggle(wmOperatorType *ot) /* view_selected operator */ -static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) +static int sequencer_view_selected_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); View2D *v2d = UI_view2d_fromcontext(C); @@ -2355,6 +2356,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) } if (ymax != 0) { + const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); xmax += xmargin; xmin -= xmargin; @@ -2377,7 +2379,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) cur_new.ymax = ymid + (orig_height / 2); } - UI_view2d_smooth_view(C, ar, &cur_new); + UI_view2d_smooth_view(C, ar, &cur_new, smooth_viewtx); return OPERATOR_FINISHED; } |