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_graph | |
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_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 5546682e470..274c06bf871 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -214,7 +214,8 @@ void GRAPH_OT_previewrange_set(wmOperatorType *ot) /* ****************** View-All Operator ****************** */ -static int graphkeys_viewall(bContext *C, const short do_sel_only, const short include_handles) +static int graphkeys_viewall(bContext *C, const short do_sel_only, const short include_handles, + const int smooth_viewtx) { bAnimContext ac; rctf cur_new; @@ -231,7 +232,7 @@ static int graphkeys_viewall(bContext *C, const short do_sel_only, const short i BLI_rctf_scale(&cur_new, 1.1f); - UI_view2d_smooth_view(C, ac.ar, &cur_new); + UI_view2d_smooth_view(C, ac.ar, &cur_new, smooth_viewtx); return OPERATOR_FINISHED; } @@ -240,18 +241,20 @@ static int graphkeys_viewall(bContext *C, const short do_sel_only, const short i static int graphkeys_viewall_exec(bContext *C, wmOperator *op) { - short include_handles = RNA_boolean_get(op->ptr, "include_handles"); + const short include_handles = RNA_boolean_get(op->ptr, "include_handles"); + const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); /* whole range */ - return graphkeys_viewall(C, FALSE, include_handles); + return graphkeys_viewall(C, false, include_handles, smooth_viewtx); } static int graphkeys_view_selected_exec(bContext *C, wmOperator *op) { - short include_handles = RNA_boolean_get(op->ptr, "include_handles"); + const short include_handles = RNA_boolean_get(op->ptr, "include_handles"); + const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); /* only selected */ - return graphkeys_viewall(C, TRUE, include_handles); + return graphkeys_viewall(C, true, include_handles, smooth_viewtx); } void GRAPH_OT_view_all(wmOperatorType *ot) |