Graph Editor: Added 2D Cursor

I've finally given in, and implemented a '2d-cursor' for the Graph Editor. This is simply represented as an additional horizontal line that meets with the current frame indicator, forming a cross-hair. It can be disabled from the View menu.

Currently, the only tool which takes this into account is the Snapping tools (Shift-S), where I've hooked up a tool I added some time ago. 

TODO:
- expose this cursor to the transform tools for scaling/rotation options...
This commit is contained in:
2009-10-20 12:04:56 +00:00
parent ec6bccfad1
commit 00f3d83b6a
10 changed files with 204 additions and 77 deletions

View File

@@ -81,6 +81,7 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemS(layout);
uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0);
uiItemR(layout, NULL, 0, &spaceptr, "show_cursor", 0);
uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0);
uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0);
@@ -162,6 +163,7 @@ static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_CFRA);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_VALUE);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_FRAME);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_SECOND);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_MARKER);