From facc127e727ed34d385b069edcf83a443a1c75c0 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 17 Apr 2016 12:26:44 +1200 Subject: "View Frame" now works in the sequencer too --- .../editors/space_sequencer/sequencer_edit.c | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index df3e508ae0e..e3cdedf042b 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -61,6 +61,7 @@ /* for menu/popup icons etc etc*/ +#include "ED_anim_api.h" #include "ED_numinput.h" #include "ED_screen.h" #include "ED_transform.h" @@ -2697,6 +2698,29 @@ void SEQUENCER_OT_view_all(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER; } +static int sequencer_view_frame_exec(bContext *C, wmOperator *op) +{ + const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); + ANIM_center_frame(C, smooth_viewtx); + + return OPERATOR_FINISHED; +} + +void SEQUENCER_OT_view_frame(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "View Frame"; + ot->idname = "SEQUENCER_OT_view_frame"; + ot->description = "Reset viewable area to show range around current frame"; + + /* api callbacks */ + ot->exec = sequencer_view_frame_exec; + ot->poll = ED_operator_sequencer_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} + /* view_all operator */ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op)) { -- cgit v1.2.3