Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2016-04-16 18:44:10 +0300
committerJoshua Leung <aligorith@gmail.com>2016-04-16 18:44:10 +0300
commitb973911feeec1bf487b35245005406fb32018cbf (patch)
treefe51cfc0ed772e90ff9d4eb9504789b081c19a94 /source/blender/editors/space_action
parent5d6b695f00c839c34e4d9d9b371ca0a71ee46dbc (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_action')
-rw-r--r--source/blender/editors/space_action/action_edit.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 9cc138b2cc4..b69547b0506 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -431,13 +431,7 @@ static int actkeys_viewsel_exec(bContext *C, wmOperator *UNUSED(op))
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);
- ANIM_center_frame(C, smooth_viewtx);
-
- return OPERATOR_FINISHED;
-}
+/* ......... */
void ACTION_OT_view_all(wmOperatorType *ot)
{
@@ -469,17 +463,27 @@ void ACTION_OT_view_selected(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
+/* ****************** View-All Operator ****************** */
+
+static int actkeys_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 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... */
-
+ ot->poll = ED_operator_action_active;
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}