[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22434] branches/blender2.5/blender: 2. 5 Timeline:

Thomas Dinges dingto at gmx.de
Thu Aug 13 18:59:52 CEST 2009


Revision: 22434
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22434
Author:   dingto
Date:     2009-08-13 18:59:52 +0200 (Thu, 13 Aug 2009)

Log Message:
-----------
2.5 Timeline:

WIP Commit, still uncommented.
* Adeed some RNA properties for Playback.
* Start of Python File.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/space_time/space_time.c
    branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c

Added Paths:
-----------
    branches/blender2.5/blender/release/ui/space_time.py

Added: branches/blender2.5/blender/release/ui/space_time.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_time.py	                        (rev 0)
+++ branches/blender2.5/blender/release/ui/space_time.py	2009-08-13 16:59:52 UTC (rev 22434)
@@ -0,0 +1,79 @@
+
+import bpy
+
+class TIME_HT_header(bpy.types.Header):
+	__space_type__ = "TIMELINE"
+
+	def draw(self, context):
+		layout = self.layout
+		
+		st = context.space_data
+		scene = context.scene
+
+		layout.template_header()
+
+		if context.area.show_menus:
+			row = layout.row()
+			#row.itemM("TIME_MT_view")
+			#row.itemM("TIME_MT_frame")
+			#row.itemM("TIME_MT_playback")
+
+		layout.itemR(scene, "use_preview_range", text="PR", toggle=True)
+		
+		layout.itemS()
+		
+		row = layout.row(align=True)
+		if not scene.use_preview_range:
+			row.itemR(scene, "start_frame", text="Start")
+			row.itemR(scene, "end_frame", text="End")
+		else:
+			row.itemR(scene, "preview_range_start_frame", text="Start")
+			row.itemR(scene, "preview_range_end_frame", text="End")
+		
+		layout.itemS()
+		layout.itemR(scene, "current_frame")
+		
+		layout.itemS()
+		
+		# XXX: Pause Button
+		row = layout.row(align=True)
+		row.itemO("screen.frame_jump", text="", icon='ICON_REW')
+		row.itemO("screen.keyframe_jump", text="", icon='ICON_PREV_KEYFRAME')
+		row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
+		row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
+		row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
+		row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
+
+"""
+class TIME_MT_view(bpy.types.Menu):
+	__space_type__ = "TEXT_EDITOR"
+	__label__ = "View"
+
+	def draw(self, context):
+		layout = self.layout
+		
+		st = context.space_data
+		
+class TIME_MT_frame(bpy.types.Menu):
+	__space_type__ = "TEXT_EDITOR"
+	__label__ = "Frame"
+
+	def draw(self, context):
+		layout = self.layout
+		
+		st = context.space_data
+
+class TIME_MT_playback(bpy.types.Menu):
+	__space_type__ = "TEXT_EDITOR"
+	__label__ = "Playback"
+
+	def draw(self, context):
+		layout = self.layout
+		
+		st = context.space_data
+"""
+
+bpy.types.register(TIME_HT_header)
+#bpy.types.register(TIME_MT_view)
+#bpy.types.register(TIME_MT_frame)
+#bpy.types.register(TIME_MT_playback)

Modified: branches/blender2.5/blender/source/blender/editors/space_time/space_time.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_time/space_time.c	2009-08-13 15:56:24 UTC (rev 22433)
+++ branches/blender2.5/blender/source/blender/editors/space_time/space_time.c	2009-08-13 16:59:52 UTC (rev 22434)
@@ -270,14 +270,23 @@
 
 /* ************************ header time area region *********************** */
 
+//#define PY_HEADER
 /* add handlers, stuff you only do once or on area/region changes */
 static void time_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
+#ifdef PY_HEADER
+	ED_region_header_init(ar);
+#else
 	UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
+#endif
 }
 
 static void time_header_area_draw(const bContext *C, ARegion *ar)
 {
+#ifdef PY_HEADER
+	ED_region_header(C, ar);
+#else
+
 	float col[3];
 
 	/* clear */
@@ -293,7 +302,8 @@
 	UI_view2d_view_ortho(C, &ar->v2d);
 	
 	time_header_buttons(C, ar);
-	
+#endif
+
 	/* restore view matrix? */
 	UI_view2d_view_restore(C);
 }

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009-08-13 15:56:24 UTC (rev 22433)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009-08-13 16:59:52 UTC (rev 22434)
@@ -393,6 +393,7 @@
 extern StructRNA RNA_SpaceGraphEditor;
 extern StructRNA RNA_SpaceImageEditor;
 extern StructRNA RNA_SpaceNLA;
+extern StructRNA RNA_SpaceTimeline;
 extern StructRNA RNA_SpaceOutliner;
 extern StructRNA RNA_SpaceSequenceEditor;
 extern StructRNA RNA_SpaceTextEditor;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c	2009-08-13 15:56:24 UTC (rev 22433)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c	2009-08-13 16:59:52 UTC (rev 22434)
@@ -118,10 +118,10 @@
 		case SPACE_NLA:
 			return &RNA_SpaceNLA;
 		/*case SPACE_SCRIPT:
-			return &RNA_SpaceScriptsWindow;
+			return &RNA_SpaceScriptsWindow;*/
 		case SPACE_TIME:
 			return &RNA_SpaceTimeline;
-		case SPACE_NODE:
+		/*case SPACE_NODE:
 			return &RNA_SpaceNodeEditor;
 		case SPACE_LOGIC:
 			return &RNA_SpaceLogicEditor;*/
@@ -1104,6 +1104,48 @@
 	// TODO... autosnap, dopesheet?
 }
 
+static void rna_def_space_time(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+	
+	srna= RNA_def_struct(brna, "SpaceTimeline", "Space");
+	RNA_def_struct_sdna(srna, "SpaceTime");
+	RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data.");
+	
+	/* Define Anim Playback Areas */
+	
+	prop= RNA_def_property(srna, "play_top_left", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_REGION);
+	RNA_def_property_ui_text(prop, "Top-Left 3D Window", "");
+	
+	prop= RNA_def_property(srna, "play_all_3d", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ALL_3D_WIN);
+	RNA_def_property_ui_text(prop, "All 3D Windows", "");
+	
+	prop= RNA_def_property(srna, "play_anim", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ALL_ANIM_WIN);
+	RNA_def_property_ui_text(prop, "Animation Windows", "");
+	
+	prop= RNA_def_property(srna, "play_buttons", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ALL_BUTS_WIN);
+	RNA_def_property_ui_text(prop, "Buttons Windows", "");
+	
+	prop= RNA_def_property(srna, "play_image", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ALL_IMAGE_WIN);
+	RNA_def_property_ui_text(prop, "Image Windows", "");
+	
+	prop= RNA_def_property(srna, "play_sequencer", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_SEQ);
+	RNA_def_property_ui_text(prop, "Sequencer Windows", "");
+	
+	/* Other options */
+	
+	prop= RNA_def_property(srna, "continue_physics", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CONTINUE_PHYSICS);
+	RNA_def_property_ui_text(prop, "Continue Physics", "During playblack, continue physics simulations regardless of the frame number");	
+}
+
 static void rna_def_console_line(BlenderRNA *brna)
 {
 	StructRNA *srna;
@@ -1332,6 +1374,7 @@
 	rna_def_space_dopesheet(brna);
 	rna_def_space_graph(brna);
 	rna_def_space_nla(brna);
+	rna_def_space_time(brna);
 	rna_def_space_console(brna);
 	rna_def_console_line(brna);
 }





More information about the Bf-blender-cvs mailing list