diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-04-16 18:44:10 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-04-16 18:44:10 +0300 |
commit | b973911feeec1bf487b35245005406fb32018cbf (patch) | |
tree | fe51cfc0ed772e90ff9d4eb9504789b081c19a94 /source/blender/editors/space_nla/nla_edit.c | |
parent | 5d6b695f00c839c34e4d9d9b371ca0a71ee46dbc (diff) |
Anim Editors: "View Frame" Operator - Code Cleanups/Reshuffling + NLA/Timeline Support
* Reshuffled code for existing "View Frame" implementations, and removed leftover
comment from some of the the copy-and-paste used to build it.
* Added support for this operator in the NLA and Timeline
Diffstat (limited to 'source/blender/editors/space_nla/nla_edit.c')
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 02814e385c0..baf87f3fee5 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -542,6 +542,30 @@ void NLA_OT_view_selected(wmOperatorType *ot) } /* *********************************************** */ + +static int nlaedit_viewframe_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 NLA_OT_view_frame(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "View Frame"; + ot->idname = "NLA_OT_view_frame"; + ot->description = "Reset viewable area to show range around current frame"; + + /* api callbacks */ + ot->exec = nlaedit_viewframe_exec; + ot->poll = ED_operator_nla_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} + +/* *********************************************** */ /* NLA Editing Operations (Constructive/Destructive) */ /* ******************** Add Action-Clip Operator ***************************** */ |