[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30966] trunk/blender/release/scripts/ui/ space_sequencer.py: fix for sequencer panel registration, a parent class panel was being registered as well as its children which crashed running the poll () function.
Campbell Barton
ideasman42 at gmail.com
Mon Aug 2 06:10:37 CEST 2010
Revision: 30966
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30966
Author: campbellbarton
Date: 2010-08-02 06:10:16 +0200 (Mon, 02 Aug 2010)
Log Message:
-----------
fix for sequencer panel registration, a parent class panel was being registered as well as its children which crashed running the poll() function.
theres not much point in having 3 classes here, just use 1.
Modified Paths:
--------------
trunk/blender/release/scripts/ui/space_sequencer.py
Modified: trunk/blender/release/scripts/ui/space_sequencer.py
===================================================================
--- trunk/blender/release/scripts/ui/space_sequencer.py 2010-08-02 03:39:12 UTC (rev 30965)
+++ trunk/blender/release/scripts/ui/space_sequencer.py 2010-08-02 04:10:16 UTC (rev 30966)
@@ -528,16 +528,42 @@
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
'MULTICAM', 'SPEED')
- def draw_filename(self, context):
- pass
-
def draw(self, context):
layout = self.layout
strip = act_strip(context)
- self.draw_filename(context)
+ seq_type = strip.type
+ # draw a filename if we have one
+ if seq_type == 'IMAGE':
+ split = layout.split(percentage=0.2)
+ col = split.column()
+ col.label(text="Path:")
+ col = split.column()
+ col.prop(strip, "directory", text="")
+
+ # Current element for the filename
+
+ elem = strip.getStripElem(context.scene.frame_current)
+ if elem:
+ split = layout.split(percentage=0.2)
+ col = split.column()
+ col.label(text="File:")
+ col = split.column()
+ col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
+
+ elif seq_type == 'MOVIE':
+ split = layout.split(percentage=0.2)
+ col = split.column()
+ col.label(text="Path:")
+ col = split.column()
+ col.prop(strip, "filepath", text="")
+ col.prop(strip, "mpeg_preseek", text="MPEG Preseek")
+ # TODO, sound???
+ # end drawing filename
+
+
layout.prop(strip, "use_translation", text="Image Offset:")
if strip.use_translation:
col = layout.column(align=True)
@@ -558,83 +584,6 @@
col.prop(strip, "animation_end_offset", text="End")
-class SEQUENCER_PT_input_movie(SEQUENCER_PT_input):
- bl_label = "Strip Input"
-
- def poll(self, context):
- if not self.has_sequencer(context):
- return False
-
- strip = act_strip(context)
- if not strip:
- return False
-
- return strip.type == 'MOVIE'
-
- def draw_filename(self, context):
- layout = self.layout
-
- strip = act_strip(context)
-
- split = layout.split(percentage=0.2)
- col = split.column()
- col.label(text="Path:")
- col = split.column()
- col.prop(strip, "filepath", text="")
- col.prop(strip, "mpeg_preseek", text="MPEG Preseek")
-
-
-class SEQUENCER_PT_input_image(SEQUENCER_PT_input):
- bl_label = "Strip Input"
-
- def poll(self, context):
- if not self.has_sequencer(context):
- return False
-
- strip = act_strip(context)
- if not strip:
- return False
-
- return strip.type == 'IMAGE'
-
- def draw_filename(self, context):
- layout = self.layout
-
- strip = act_strip(context)
-
- split = layout.split(percentage=0.2)
- col = split.column()
- col.label(text="Path:")
- col = split.column()
- col.prop(strip, "directory", text="")
-
- # Current element for the filename
-
- elem = strip.getStripElem(context.scene.frame_current)
- if elem:
- split = layout.split(percentage=0.2)
- col = split.column()
- col.label(text="File:")
- col = split.column()
- col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
-
-
-class SEQUENCER_PT_input_secondary(SEQUENCER_PT_input):
- bl_label = "Strip Input"
-
- def poll(self, context):
- if not self.has_sequencer(context):
- return False
-
- strip = act_strip(context)
- if not strip:
- return False
-
- return strip.type in ('SCENE', 'META')
-
- def draw_filename(self, context):
- pass
-
class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel):
bl_label = "Sound"
More information about the Bf-blender-cvs
mailing list