[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20744] branches/blender2.5/blender: - rna wrapped sequencer space

Campbell Barton ideasman42 at gmail.com
Tue Jun 9 07:39:01 CEST 2009


Revision: 20744
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20744
Author:   campbellbarton
Date:     2009-06-09 07:39:01 +0200 (Tue, 09 Jun 2009)

Log Message:
-----------
- rna wrapped sequencer space
- uiItemEnumO_string, forgot to actually set the enum value
- added more sequencer header buttons (these should probably be moved to a view panel eventually)

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/space_sequencer.py
    branches/blender2.5/blender/source/blender/editors/interface/interface_layout.c
    branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c

Modified: branches/blender2.5/blender/release/ui/space_sequencer.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_sequencer.py	2009-06-09 05:17:32 UTC (rev 20743)
+++ branches/blender2.5/blender/release/ui/space_sequencer.py	2009-06-09 05:39:01 UTC (rev 20744)
@@ -20,10 +20,24 @@
 		if context.area.show_menus:
 			row = layout.row(align=True)
 			row.itemM(context, "SEQUENCER_MT_view")
-			row.itemM(context, "SEQUENCER_MT_select")
-			row.itemM(context, "SEQUENCER_MT_marker")
-			row.itemM(context, "SEQUENCER_MT_add")
-			row.itemM(context, "SEQUENCER_MT_strip")
+			
+			row.itemR(st, "display_mode")
+			
+			layout.itemS()
+			
+			if st.display_mode == 'SEQUENCER':
+				row.itemM(context, "SEQUENCER_MT_select")
+				row.itemM(context, "SEQUENCER_MT_marker")
+				row.itemM(context, "SEQUENCER_MT_add")
+				row.itemM(context, "SEQUENCER_MT_strip")
+				layout.itemS()
+				row.itemO("SEQUENCER_OT_reload")
+			else:
+				row.itemR(st, "display_channel") # text="Chan"
+				layout.itemS()
+				row.itemR(st, "draw_overexposed") # text="Zebra"
+				layout.itemS()
+				row.itemR(st, "draw_safe_margin")
 
 class SEQUENCER_MT_view(bpy.types.Menu):
 	__space_type__ = "SEQUENCE_EDITOR"
@@ -77,13 +91,11 @@
 
 	/* Draw time or frames.*/
 	uiDefMenuSep(block);
-
-	if(sseq->flag & SEQ_DRAWFRAMES)
-		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-	else
-		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
-	
+		"""
+		
+		layout.itemR(st, "draw_frames")
+		
+		"""
 	if(!sa->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,0, "");
 	else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
 
@@ -229,7 +241,7 @@
 		layout.itemO("SEQUENCER_OT_mute")
 		layout.itemO("SEQUENCER_OT_unmute")
 		
-		layout.item_enumO("SEQUENCER_OT_mute", "type", 'UNSELECTED', text="Mute Deselected Strips")
+		layout.item_enumO("SEQUENCER_OT_mute", property="type", value='UNSELECTED', text="Mute Deselected Strips")
 
 
 
@@ -448,7 +460,9 @@
 		
 		row = layout.row()
 		row.itemR(strip, "proxy_custom_directory")
-		# row.itemR(strip.proxy, "dir") # TODO
+		if strip.proxy: # TODO - need to add this somehow
+			row.itemR(strip.proxy, "dir")
+			row.itemR(strip.proxy, "file")
 
 
 bpy.types.register(SEQUENCER_HT_header)

Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_layout.c	2009-06-09 05:17:32 UTC (rev 20743)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_layout.c	2009-06-09 05:39:01 UTC (rev 20744)
@@ -608,7 +608,7 @@
 
 	WM_operator_properties_create(&ptr, opname);
 	
-	/*RNA_enum_set(&ptr, propname, value);*/
+	/* enum lookup */
 	if((prop= RNA_struct_find_property(&ptr, propname))) {
 		RNA_property_enum_items(&ptr, prop, &item, &totitem);
 		if(RNA_enum_value_from_id(item, value_str, &value)==0) {
@@ -621,6 +621,8 @@
 		return;
 	}
 	
+	RNA_property_enum_set(&ptr, prop, value);
+	
 	/* same as uiItemEnumO */
 	if(!name)
 		name= ui_menu_enumpropname(opname, propname, value);

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009-06-09 05:17:32 UTC (rev 20743)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009-06-09 05:39:01 UTC (rev 20744)
@@ -364,6 +364,7 @@
 extern StructRNA RNA_SpaceButtonsWindow;
 extern StructRNA RNA_SpaceImageEditor;
 extern StructRNA RNA_SpaceOutliner;
+extern StructRNA RNA_SpaceSequenceEditor;
 extern StructRNA RNA_SpaceTextEditor;
 extern StructRNA RNA_SpaceUVEditor;
 extern StructRNA RNA_SpeedControlSequence;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c	2009-06-09 05:17:32 UTC (rev 20743)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c	2009-06-09 05:39:01 UTC (rev 20744)
@@ -189,7 +189,11 @@
 	
 	prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
 	RNA_def_property_string_sdna(prop, NULL, "dir");
-	RNA_def_property_ui_text(prop, "Directory", "");
+	RNA_def_property_ui_text(prop, "Directory", "Location to story the proxy file");
+	
+	prop= RNA_def_property(srna, "file", PROP_STRING, PROP_DIRPATH);
+	RNA_def_property_string_sdna(prop, NULL, "file");
+	RNA_def_property_ui_text(prop, "File", "Proxy file name");
 }
 
 static void rna_def_strip_color_balance(BlenderRNA *brna)

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c	2009-06-09 05:17:32 UTC (rev 20743)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c	2009-06-09 05:39:01 UTC (rev 20744)
@@ -82,9 +82,9 @@
 		case SPACE_IMAGE:
 			return &RNA_SpaceImageEditor;
 		/*case SPACE_INFO:
-			return &RNA_SpaceUserPreferences;
+			return &RNA_SpaceUserPreferences;*/
 		case SPACE_SEQ:
-			return &RNA_SpaceSequenceEditor;*/
+			return &RNA_SpaceSequenceEditor;
 		case SPACE_TEXT:
 			return &RNA_SpaceTextEditor;
 		//case SPACE_IMASEL:
@@ -602,6 +602,89 @@
 	rna_def_space_image_uv(brna);
 }
 
+
+static void rna_def_space_sequencer(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+	
+	static EnumPropertyItem display_mode_items[] = {
+		{SEQ_DRAW_SEQUENCE, "SEQUENCER", "Sequencer", ""},
+		{SEQ_DRAW_IMG_IMBUF, "IMAGE", "Image Preview", ""},
+		{SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", "Luma Waveform", ""},
+		{SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", "Chroma Vectorscope", ""},
+		{SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", "Histogram", ""},
+		{0, NULL, NULL, NULL}};
+	
+	srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
+	RNA_def_struct_sdna(srna, "SpaceSeq");
+	RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data.");
+	
+	/* display type, fairly important */
+	prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "mainb");
+	RNA_def_property_enum_items(prop, display_mode_items);
+	RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output.");
+	RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier
+		
+	/* flag's */
+	prop= RNA_def_property(srna, "draw_frames", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
+	RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds.");
+	RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier
+	
+	prop= RNA_def_property(srna, "transform_markers", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
+	RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips.");
+	
+	prop= RNA_def_property(srna, "seperate_color_preview", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
+	RNA_def_property_ui_text(prop, "Transform Markers", "Seperate color channels in preview.");
+	RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier
+
+	prop= RNA_def_property(srna, "draw_safe_margin", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
+	RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview.");	
+	RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier
+	
+	prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
+	RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay.");	
+	RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier
+	
+	/* grease pencil */
+	prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+	RNA_def_property_pointer_sdna(prop, NULL, "gpd");
+	RNA_def_property_struct_type(prop, "UnknownType");
+	RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space.");
+	
+	prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "chanshown");
+	RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined.");
+	RNA_def_property_range(prop, 0, 32); // MAXSEQ --- todo, move from BKE_sequence.h
+	RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier
+	
+	prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "zebra");
+	RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes.");
+	RNA_def_property_range(prop, 0, 110);
+	RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier
+	
+	
+	/* not sure we need rna access to these but adding anyway */
+	prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "xof");
+	RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
+
+	prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "yof");
+	RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center");
+	
+	prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "zoom");
+	RNA_def_property_ui_text(prop, "Zoom", "Display zoom level");	
+}
+
 static void rna_def_space_text(BlenderRNA *brna)
 {
 	StructRNA *srna;
@@ -678,6 +761,7 @@
 {
 	rna_def_space(brna);
 	rna_def_space_image(brna);
+	rna_def_space_sequencer(brna);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list