[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20736] branches/blender2.5/blender: Sequencer WIP

Campbell Barton ideasman42 at gmail.com
Mon Jun 8 18:48:12 CEST 2009


Revision: 20736
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20736
Author:   campbellbarton
Date:     2009-06-08 18:48:12 +0200 (Mon, 08 Jun 2009)

Log Message:
-----------
Sequencer WIP
- Move buttons into the sequencer Nkey region
- Made the header and menu items use the python api, still need to get more buttons working.
- Fixed some minor problems

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/interface/interface_layout.c
    branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_context.c
    branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_header.c
    branches/blender2.5/blender/source/blender/editors/space_buttons/space_buttons.c
    branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_edit.c
    branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_intern.h
    branches/blender2.5/blender/source/blender/editors/space_sequencer/space_sequencer.c
    branches/blender2.5/blender/source/blender/makesdna/DNA_space_types.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c

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

Removed Paths:
-------------
    branches/blender2.5/blender/release/ui/buttons_sequencer.py
    branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_header.c

Deleted: branches/blender2.5/blender/release/ui/buttons_sequencer.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_sequencer.py	2009-06-08 16:24:37 UTC (rev 20735)
+++ branches/blender2.5/blender/release/ui/buttons_sequencer.py	2009-06-08 16:48:12 UTC (rev 20736)
@@ -1,229 +0,0 @@
-
-import bpy
-
-def act_strip(context):
-	try:		return context.scene.sequence_editor.active_strip
-	except:	return None
-
-class SequencerButtonsPanel(bpy.types.Panel):
-	__space_type__ = "BUTTONS_WINDOW"
-	__region_type__ = "WINDOW"
-	__context__ = "sequencer"
-
-	def poll(self, context):
-		return act_strip(context) != None
-
-class SEQUENCER_PT_edit(SequencerButtonsPanel):
-	__label__ = "Edit Strip"
-	__idname__ = "SEQUENCER_PT_edit"
-
-	def draw(self, context):
-		layout = self.layout
-		
-		strip = act_strip(context)
-		
-		layout.itemR(strip, "name")
-		
-		layout.itemR(strip, "blend_mode")
-		
-		layout.itemR(strip, "blend_opacity")
-		
-		row = layout.row()
-		row.itemR(strip, "mute")
-		row.itemR(strip, "lock")
-		row.itemR(strip, "frame_locked")
-		
-		row = layout.row()
-		row.itemR(strip, "channel")
-		row.itemR(strip, "start_frame")
-		
-		row = layout.row()
-		row.itemR(strip, "length")
-		row.itemR(strip, "type")
-		
-class SEQUENCER_PT_effect(SequencerButtonsPanel):
-	__label__ = "Effect Strip"
-	__idname__ = "SEQUENCER_PT_effect"
-
-	def poll(self, context):
-		strip = act_strip(context)
-		if not strip:
-			return False
-		
-		return strip.type in ('COLOR', 'WIPE', 'GLOW', 'SPEED', 'TRANSFORM')
-
-	def draw(self, context):
-		layout = self.layout
-		
-		strip = act_strip(context)
-		
-		if strip.type == 'COLOR':
-			layout.itemR(strip, "color")
-			
-		elif strip.type == 'WIPE':
-			row = layout.row()
-			row.itemL(text="Transition Type:")
-			row.itemL(text="Direction:")
-			
-			row = layout.row()
-			row.itemR(strip, "transition_type", text="")
-			row.itemR(strip, "direction", text="")
-			
-			row = layout.row()
-			row.itemR(strip, "blur_width")
-			if strip.transition_type in ('SINGLE', 'DOUBLE'):
-				row.itemR(strip, "angle")
-				
-		elif strip.type == 'GLOW':
-			flow = layout.column_flow()
-			flow.itemR(strip, "threshold")
-			flow.itemR(strip, "clamp")
-			flow.itemR(strip, "boost_factor")
-			flow.itemR(strip, "blur_distance")
-			
-			row = layout.row()
-			row.itemR(strip, "quality", slider=True)
-			row.itemR(strip, "only_boost")
-			
-		elif strip.type == 'SPEED':
-			layout.itemR(strip, "global_speed")
-			
-			flow = layout.column_flow()
-			flow.itemR(strip, "curve_velocity")
-			flow.itemR(strip, "curve_compress_y")
-			flow.itemR(strip, "frame_blending")
-			
-		elif strip.type == 'TRANSFORM':
-			row = layout.row()
-			row.itemL(text="Interpolation:")
-			row.itemL(text="Translation Unit:")
-			
-			row = layout.row()
-			row.itemR(strip, "interpolation", text="")
-			row.itemR(strip, "translation_unit", text="")
-			
-			split = layout.split()
-			
-			col = split.column()
-			sub = col.column(align=True) 
-			sub.itemL(text="Position X:")
-			sub.itemR(strip, "translate_start_x", text="Start")
-			sub.itemR(strip, "translate_end_x", text="End")
-			
-			sub = col.column(align=True) 
-			sub.itemL(text="Scale X:")
-			sub.itemR(strip, "scale_start_x", text="Start")
-			sub.itemR(strip, "scale_end_x", text="End")
-			
-			sub = col.column(align=True) 
-			sub.itemL(text="Rotation:")
-			sub.itemR(strip, "rotation_start", text="Start")
-			sub.itemR(strip, "rotation_end", text="End")
-			
-			col = split.column()
-			sub = col.column(align=True) 
-			sub.itemL(text="Position Y:")
-			sub.itemR(strip, "translate_start_y", text="Start")
-			sub.itemR(strip, "translate_end_y", text="End")
-			
-			sub = col.column(align=True) 
-			sub.itemL(text="Scale Y:")
-			sub.itemR(strip, "scale_start_y", text="Start")
-			sub.itemR(strip, "scale_end_y", text="End")
-
-class SEQUENCER_PT_input(SequencerButtonsPanel):
-	__label__ = "Strip Input"
-	__idname__ = "SEQUENCER_PT_input"
-	
-	def poll(self, context):
-		strip = act_strip(context)
-		if not strip:
-			return False
-		
-		return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
-	
-	def draw(self, context):
-		layout = self.layout
-		
-		strip = act_strip(context)
-		
-		layout.itemR(strip, "directory")
-		
-		# TODO - get current element!
-		layout.itemR(strip.elements[0], "filename")
-		
-		"""
-		layout.itemR(strip, "use_crop")
-		
-		flow = layout.column_flow()
-		flow.active = strip.use_crop
-		flow.itemR(strip, "top")
-		flow.itemR(strip, "left")
-		flow.itemR(strip, "bottom")
-		flow.itemR(strip, "right")
-		"""
-
-class SEQUENCER_PT_filter(SequencerButtonsPanel):
-	__label__ = "Filter"
-	__idname__ = "SEQUENCER_PT_filter"
-	
-	def poll(self, context):
-		strip = act_strip(context)
-		if not strip:
-			return False
-		
-		return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
-	
-	def draw(self, context):
-		layout = self.layout
-		
-		strip = act_strip(context)
-		
-		row = layout.row()
-		row.itemR(strip, "premultiply")
-		row.itemR(strip, "convert_float")
-		row.itemR(strip, "de_interlace")
-		
-		row = layout.row()
-		row.itemR(strip, "flip_x")
-		row.itemR(strip, "flip_y")
-		row.itemR(strip, "reverse_frames")
-		
-		row = layout.row()
-		row.itemR(strip, "multiply_colors")
-		row.itemR(strip, "strobe")
-		
-		layout.itemR(strip, "use_color_balance")
-
-class SEQUENCER_PT_proxy(SequencerButtonsPanel):
-	__label__ = "Proxy"
-	__idname__ = "SEQUENCER_PT_proxy"
-	
-	def poll(self, context):
-		strip = act_strip(context)
-		if not strip:
-			return False
-		
-		return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
-	
-	def draw_header(self, context):
-		strip = act_strip(context)
-
-		layout = self.layout
-		
-		layout.itemR(strip, "use_proxy", text="")
-
-	def draw(self, context):
-		strip = act_strip(context)
-		
-		layout = self.layout
-		
-		row = layout.row()
-		row.itemR(strip, "proxy_custom_directory")
-		# row.itemR(strip.proxy, "dir") # TODO
-	
-bpy.types.register(SEQUENCER_PT_edit)
-bpy.types.register(SEQUENCER_PT_effect)
-bpy.types.register(SEQUENCER_PT_input)
-bpy.types.register(SEQUENCER_PT_filter)
-bpy.types.register(SEQUENCER_PT_proxy)

Added: branches/blender2.5/blender/release/ui/space_sequencer.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_sequencer.py	                        (rev 0)
+++ branches/blender2.5/blender/release/ui/space_sequencer.py	2009-06-08 16:48:12 UTC (rev 20736)
@@ -0,0 +1,466 @@
+
+import bpy
+
+def act_strip(context):
+	try:		return context.scene.sequence_editor.active_strip
+	except:	return None
+
+# Header
+class SEQUENCER_HT_header(bpy.types.Header):
+	__space_type__ = "SEQUENCE_EDITOR"
+	__idname__ = "SEQUENCE_HT_header"
+
+	def draw(self, context):
+		
+		st = context.space_data
+		layout = self.layout
+
+		layout.template_header(context)
+		
+		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")
+
+class SEQUENCER_MT_view(bpy.types.Menu):
+	__space_type__ = "SEQUENCE_EDITOR"
+	__label__ = "View (TODO)"
+	
+	def draw(self, context):
+		layout = self.layout
+		st = context.space_data
+		
+		layout.column()
+		
+		"""
+	uiBlock *block= uiBeginBlock(C, ar, "seq_viewmenu", UI_EMBOSSP);
+	short yco= 0, menuwidth=120;
+
+	if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
+		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+				 "Play Back Animation "
+				 "in all Sequence Areas|Alt A", 0, yco-=20,
+				 menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
+	}
+	else {
+		uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL,
+				 "Grease Pencil...", 0, yco-=20,
+				 menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
+		uiDefMenuSep(block);
+
+		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+				 "Play Back Animation "
+				 "in this window|Alt A", 0, yco-=20,
+				 menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
+	}
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+			 "Play Back Animation in all "
+			 "3D Views and Sequence Areas|Alt Shift A",
+			 0, yco-=20,
+			 menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
+
+		"""
+		layout.itemS()
+		layout.itemO("SEQUENCER_OT_view_all")
+		layout.itemO("SEQUENCER_OT_view_selected")
+		layout.itemS()
+		"""
+	
+
+	/* Lock Time */
+	uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
+			"Lock Time to Other Windows|", 0, yco-=20,
+			menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
+
+	/* 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, "");
+
+	
+	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, "");
+
+		"""
+
+class SEQUENCER_MT_select(bpy.types.Menu):
+	__space_type__ = "SEQUENCE_EDITOR"
+	__label__ = "Select"
+
+	def draw(self, context):
+		layout = self.layout
+		st = context.space_data
+		
+		layout.column()
+		layout.item_enumO("SEQUENCER_OT_select_active_side", "side", 'LEFT', text="Strips to the Left")
+		layout.item_enumO("SEQUENCER_OT_select_active_side", "side", 'RIGHT', text="Strips to the Right")
+		layout.itemS()
+		layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'BOTH', text="Surrounding Handles")
+		layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'LEFT', text="Left Handle")
+		layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'RIGHT', text="Right Handle")
+		layout.itemS()
+		layout.itemO("SEQUENCER_OT_select_linked")
+		layout.itemO("SEQUENCER_OT_select_all_toggle")
+		layout.itemO("SEQUENCER_OT_select_invert")
+
+class SEQUENCER_MT_marker(bpy.types.Menu):
+	__space_type__ = "SEQUENCE_EDITOR"
+	__label__ = "Marker (TODO)"
+
+	def draw(self, context):
+		layout = self.layout
+		st = context.space_data
+		
+		layout.column()
+		layout.itemO("SEQUENCER_OT_sound_strip_add", text="Add Marker|Ctrl Alt M")
+		layout.itemO("SEQUENCER_OT_sound_strip_add", text="Duplicate Marker|Ctrl Shift D")

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list