diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-04-13 15:30:17 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-04-13 15:30:24 +0300 |
commit | 364b6b29ff2ea19a31fdfc8e08b75ce0d46df40b (patch) | |
tree | 218281443faa4617bb5a899e375dec06a01de19a /source/blender/editors/space_action/action_edit.c | |
parent | d1f9fcaabcc64f224467523bb1258c59ebfb8209 (diff) |
New operator for action and graph editor that centers around current
scene frame, bound to numberpad zero.
Diffstat (limited to 'source/blender/editors/space_action/action_edit.c')
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 4b8ddacb418..d83137d4cb0 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -425,7 +425,15 @@ static int actkeys_viewsel_exec(bContext *C, wmOperator *UNUSED(op)) /* only selected */ return actkeys_viewall(C, true); } - + +static int actkeys_view_frame_exec(bContext *C, wmOperator *op) +{ + const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); + UI_view2d_center_frame(C, smooth_viewtx); + + return OPERATOR_FINISHED; +} + void ACTION_OT_view_all(wmOperatorType *ot) { /* identifiers */ @@ -456,6 +464,21 @@ void ACTION_OT_view_selected(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } +void ACTION_OT_view_frame(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "View Frame"; + ot->idname = "ACTION_OT_view_frame"; + ot->description = "Reset viewable area to show range around current frame"; + + /* api callbacks */ + ot->exec = actkeys_view_frame_exec; + ot->poll = ED_operator_action_active; /* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... */ + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} + /* ************************************************************************** */ /* GENERAL STUFF */ |