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>2015-10-10 08:26:09 +0300
committerJoshua Leung <aligorith@gmail.com>2015-10-26 10:18:10 +0300
commit65072499c65affaf26e2e6912129387ba54211f1 (patch)
tree9be728f60cb29e26e980123177235a9d022f6250 /source/blender/editors/space_graph/graph_buttons.c
parent2092056745064f8ce41863f1856d902588dc39f9 (diff)
Graph Editor: Allow "cursor x" to have fractional values when working with Drivers (T46004)
When working is the Graph Editor it can be very important to be able to work with fractions (sub integers), especially when working with Drivers. Currently the "Cursor Y" is hooked up to "cursor_position_y" which allows fractions but "Cursor X" is directly hooked up to "frame_current" which is an integer. This commit adds initial support for this feature. * When in Drivers mode, the x-part of the cursor is mapped to a new "cursor_position_x" value which can have fractional values. Animation mode however remains mapped to frame_current * This commit only adds the UI/property/drawing tweaks needed to support this. Many operators still need to be modified to consider this value instead of the current frame, for this to be more useful.
Diffstat (limited to 'source/blender/editors/space_graph/graph_buttons.c')
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 713f101accb..1bab7bd349c 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -133,7 +133,10 @@ static void graph_panel_view(const bContext *C, Panel *pa)
sub = uiLayoutColumn(col, true);
uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor"));
row = uiLayoutSplit(sub, 0.7f, true);
- uiItemR(row, &sceneptr, "frame_current", 0, IFACE_("Cursor X"), ICON_NONE);
+ if (sipo->mode == SIPO_MODE_DRIVERS)
+ uiItemR(row, &spaceptr, "cursor_position_x", 0, IFACE_("Cursor X"), ICON_NONE);
+ else
+ uiItemR(row, &sceneptr, "frame_current", 0, IFACE_("Cursor X"), ICON_NONE);
uiItemEnumO(row, "GRAPH_OT_snap", IFACE_("To Keys"), 0, "type", GRAPHKEYS_SNAP_CFRA);
row = uiLayoutSplit(sub, 0.7f, true);