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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-01-26 15:49:38 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-01-26 15:49:38 +0400
commitdb57cbac20bb513ba688c5cfb2655d8753a89aab (patch)
tree3064e8c00b8a17b6d56aeda9bc650f6955a96af8 /source/blender/editors/space_clip/clip_graph_ops.c
parente19d78178de0eeb8cdadcbbe7b7d78d950d85007 (diff)
More curves view improvements for clip editor:
- Renamed graph_jump_to_current_frame to graph_center_current_frame which makes more sense. - Curve view now can be locked to time cursor (Lock to Time Cursor in Display panel or L button in curve view). Not sure if offset from locked position will make much sense here. - Added hotkey for solving -- Shift-S.
Diffstat (limited to 'source/blender/editors/space_clip/clip_graph_ops.c')
-rw-r--r--source/blender/editors/space_clip/clip_graph_ops.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c
index 7652e59a9a8..6a56de26689 100644
--- a/source/blender/editors/space_clip/clip_graph_ops.c
+++ b/source/blender/editors/space_clip/clip_graph_ops.c
@@ -447,30 +447,36 @@ void CLIP_OT_graph_view_all(wmOperatorType *ot)
/******************** jump to current frame operator ********************/
-static int jump_to_current_frame_exec(bContext *C, wmOperator *UNUSED(op))
+void ED_clip_graph_center_current_frame(Scene *scene, ARegion *ar)
{
- Scene *scene = CTX_data_scene(C);
- ARegion *ar = CTX_wm_region(C);
View2D *v2d = &ar->v2d;
float extra = (v2d->cur.xmax - v2d->cur.xmin) / 2.0;
/* set extents of view to start/end frames */
v2d->cur.xmin = (float)CFRA - extra;
v2d->cur.xmax = (float)CFRA + extra;
+}
+
+static int center_current_frame_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Scene *scene = CTX_data_scene(C);
+ ARegion *ar = CTX_wm_region(C);
+
+ ED_clip_graph_center_current_frame(scene, ar);
ED_region_tag_redraw(ar);
return OPERATOR_FINISHED;
}
-void CLIP_OT_graph_jump_to_current_frame(wmOperatorType *ot)
+void CLIP_OT_graph_center_current_frame(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Jump to current frame";
- ot->description = "Jump to current frame";
- ot->idname = "CLIP_OT_graph_jump_to_current_frame";
+ ot->name = "Center Current Frame";
+ ot->description = "Scroll view so current frame would be centered";
+ ot->idname = "CLIP_OT_graph_center_current_frame";
/* api callbacks */
- ot->exec = jump_to_current_frame_exec;
+ ot->exec = center_current_frame_exec;
ot->poll = ED_space_clip_graph_poll;
}