[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24108] trunk/blender/source/blender/ editors/space_graph/graph_buttons.c: Graph Editor: Added panel for numerically adjusting the cursor position
Joshua Leung
aligorith at gmail.com
Tue Oct 27 12:46:46 CET 2009
Revision: 24108
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24108
Author: aligorith
Date: 2009-10-27 12:46:46 +0100 (Tue, 27 Oct 2009)
Log Message:
-----------
Graph Editor: Added panel for numerically adjusting the cursor position
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_graph/graph_buttons.c
Modified: trunk/blender/source/blender/editors/space_graph/graph_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_buttons.c 2009-10-27 11:10:30 UTC (rev 24107)
+++ trunk/blender/source/blender/editors/space_graph/graph_buttons.c 2009-10-27 11:46:46 UTC (rev 24108)
@@ -105,6 +105,8 @@
//WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob);
}
+/* -------------- */
+
static int graph_panel_context(const bContext *C, bAnimListElem **ale, FCurve **fcu)
{
bAnimContext ac;
@@ -136,6 +138,37 @@
return graph_panel_context(C, NULL, NULL);
}
+/* -------------- */
+
+/* Graph Editor View Settings */
+static void graph_panel_view(const bContext *C, Panel *pa)
+{
+ bScreen *sc= CTX_wm_screen(C);
+ SpaceIpo *sipo= CTX_wm_space_graph(C);
+ Scene *scene= CTX_data_scene(C);
+ PointerRNA spaceptr, sceneptr;
+ uiLayout *col, *subcol;
+
+ /* get RNA pointers for use when creating the UI elements */
+ RNA_id_pointer_create(&scene->id, &sceneptr);
+ RNA_pointer_create(&sc->id, &RNA_SpaceGraphEditor, sipo, &spaceptr);
+
+ /* 2D-Cursor */
+ col= uiLayoutColumn(pa->layout, 0);
+ uiItemR(col, NULL, 0, &spaceptr, "show_cursor", 0);
+
+ subcol= uiLayoutColumn(col, 1);
+ uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor"));
+ uiItemR(subcol, "Cursor X", 0, &sceneptr, "current_frame", 0);
+ uiItemR(subcol, "Cursor Y", 0, &spaceptr, "cursor_value", 0);
+
+ subcol= uiLayoutColumn(col, 1);
+ uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor"));
+ uiItemO(subcol, "Cursor from Selection", 0, "GRAPH_OT_frame_jump");
+}
+
+/* ******************* active F-Curve ************** */
+
static void graph_panel_properties(const bContext *C, Panel *pa)
{
bAnimListElem *ale;
@@ -413,6 +446,12 @@
{
PanelType *pt;
+ pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel view");
+ strcpy(pt->idname, "GRAPH_PT_view");
+ strcpy(pt->label, "View");
+ pt->draw= graph_panel_view;
+ BLI_addtail(&art->paneltypes, pt);
+
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
strcpy(pt->idname, "GRAPH_PT_properties");
strcpy(pt->label, "Properties");
More information about the Bf-blender-cvs
mailing list