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
path: root/source
diff options
context:
space:
mode:
authorElia Sarti <vekoon@gmail.com>2009-12-08 00:51:44 +0300
committerElia Sarti <vekoon@gmail.com>2009-12-08 00:51:44 +0300
commitb71749305a3b6db54f6676e87803703aa7acdebb (patch)
treea8def845a5bba8607837881c18a9014773e419be /source
parentce49719a0c9baf75576929f956e1224fcd46afc7 (diff)
Pythonazed DopeSheet and NLA editors headers UI.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_action/space_action.c21
-rw-r--r--source/blender/editors/space_nla/space_nla.c21
-rw-r--r--source/blender/makesrna/intern/rna_space.c45
3 files changed, 37 insertions, 50 deletions
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index d4f8fcfb449..0bf3e3f70cb 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -259,29 +259,12 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar)
/* add handlers, stuff you only do once or on area/region changes */
static void action_header_area_init(wmWindowManager *wm, ARegion *ar)
{
- UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
+ ED_region_header_init(ar);
}
static void action_header_area_draw(const bContext *C, ARegion *ar)
{
- float col[3];
-
- /* clear */
- if(ED_screen_area_active(C))
- UI_GetThemeColor3fv(TH_HEADER, col);
- else
- UI_GetThemeColor3fv(TH_HEADERDESEL, col);
-
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- /* set view2d view matrix for scrolling (without scrollers) */
- UI_view2d_view_ortho(C, &ar->v2d);
-
- action_header_buttons(C, ar);
-
- /* restore view matrix? */
- UI_view2d_view_restore(C);
+ ED_region_header(C, ar);
}
static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index a019e684239..572ad44f680 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -331,29 +331,12 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar)
/* add handlers, stuff you only do once or on area/region changes */
static void nla_header_area_init(wmWindowManager *wm, ARegion *ar)
{
- UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
+ ED_region_header_init(ar);
}
static void nla_header_area_draw(const bContext *C, ARegion *ar)
{
- float col[3];
-
- /* clear */
- if(ED_screen_area_active(C))
- UI_GetThemeColor3fv(TH_HEADER, col);
- else
- UI_GetThemeColor3fv(TH_HEADERDESEL, col);
-
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- /* set view2d view matrix for scrolling (without scrollers) */
- UI_view2d_view_ortho(C, &ar->v2d);
-
- nla_header_buttons(C, ar);
-
- /* restore view matrix? */
- UI_view2d_view_restore(C);
+ ED_region_header(C, ar);
}
/* add handlers, stuff you only do once or on area/region changes */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index ef5f8ccb87b..4a55d259be9 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -83,6 +83,13 @@ static EnumPropertyItem transform_orientation_items[] = {
{V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
{0, NULL, 0, NULL, NULL}};
+static EnumPropertyItem autosnap_items[] = {
+ {SACTSNAP_OFF, "NONE", 0, "None", ""},
+ {SACTSNAP_STEP, "STEP", 0, "Step", "Snap to 1.0 frame/second intervals."},
+ {SACTSNAP_FRAME, "FRAME", 0, "Frame", "Snap to actual frames/seconds (nla-action time)."},
+ {SACTSNAP_MARKER, "MARKER", 0, "Marker", "Snap to nearest marker."},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "DNA_anim_types.h"
@@ -1262,8 +1269,19 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
-
- // TODO... autosnap, dopesheet?
+
+ /* dopesheet */
+ prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "DopeSheet");
+ RNA_def_property_pointer_sdna(prop, NULL, "ads");
+ RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data.");
+
+ /* autosnap */
+ prop= RNA_def_property(srna, "autosnap", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "autosnap");
+ RNA_def_property_enum_items(prop, autosnap_items);
+ RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations.");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
}
static void rna_def_space_graph(BlenderRNA *brna)
@@ -1285,13 +1303,6 @@ static void rna_def_space_graph(BlenderRNA *brna)
//{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem autosnap_items[] = {
- {SACTSNAP_OFF, "NONE", 0, "None", ""},
- {SACTSNAP_STEP, "STEP", 0, "Step", "Snap to 1.0 frame/second intervals."},
- {SACTSNAP_FRAME, "FRAME", 0, "Frame", "Snap to actual frames/seconds (nla-action time)."},
- {SACTSNAP_MARKER, "MARKER", 0, "Marker", "Snap to nearest marker."},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceIpo");
@@ -1398,9 +1409,19 @@ static void rna_def_space_nla(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
-
- /* editing */
- // TODO... autosnap, dopesheet?
+
+ /* dopesheet */
+ prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "DopeSheet");
+ RNA_def_property_pointer_sdna(prop, NULL, "ads");
+ RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data.");
+
+ /* autosnap */
+ prop= RNA_def_property(srna, "autosnap", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "autosnap");
+ RNA_def_property_enum_items(prop, autosnap_items);
+ RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations.");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
}
static void rna_def_space_time(BlenderRNA *brna)