[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31083] trunk/blender/release/scripts/ui: some fixes for the poll() function from last commit.

Campbell Barton ideasman42 at gmail.com
Thu Aug 5 23:58:57 CEST 2010


Revision: 31083
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31083
Author:   campbellbarton
Date:     2010-08-05 23:58:57 +0200 (Thu, 05 Aug 2010)

Log Message:
-----------
some fixes for the poll() function from last commit.
Martin: forgot to mention, had to remove the use of super() in poll functions for netrender. commented with FIXME.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_sequencer.py
    trunk/blender/release/scripts/ui/space_view3d.py

Modified: trunk/blender/release/scripts/ui/space_sequencer.py
===================================================================
--- trunk/blender/release/scripts/ui/space_sequencer.py	2010-08-05 20:16:38 UTC (rev 31082)
+++ trunk/blender/release/scripts/ui/space_sequencer.py	2010-08-05 21:58:57 UTC (rev 31083)
@@ -316,24 +316,26 @@
     bl_space_type = 'SEQUENCE_EDITOR'
     bl_region_type = 'UI'
 
-    def has_sequencer(self, context):
+    @staticmethod
+    def has_sequencer(context):
         return (context.space_data.view_type == 'SEQUENCER') or (context.space_data.view_type == 'SEQUENCER_PREVIEW')
 
     @staticmethod
     def poll(context):
-        return self.has_sequencer(context) and (act_strip(context) is not None)
+        return __class__.has_sequencer(context) and (act_strip(context) is not None)
 
 
 class SequencerButtonsPanel_Output():
     bl_space_type = 'SEQUENCE_EDITOR'
     bl_region_type = 'UI'
 
-    def has_preview(self, context):
+    @staticmethod
+    def has_preview(context):
         return (context.space_data.view_type == 'PREVIEW') or (context.space_data.view_type == 'SEQUENCER_PREVIEW')
 
     @staticmethod
     def poll(context):
-        return self.has_preview(context)
+        return __class__.has_preview(context)
 
 
 class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel):
@@ -388,7 +390,7 @@
 
     @staticmethod
     def poll(context):
-        if not self.has_sequencer(context):
+        if not __class__.has_sequencer(context):
             return False
 
         strip = act_strip(context)
@@ -518,7 +520,7 @@
 
     @staticmethod
     def poll(context):
-        if not self.has_sequencer(context):
+        if not __class__.has_sequencer(context):
             return False
 
         strip = act_strip(context)
@@ -584,8 +586,8 @@
 
         col = layout.column(align=True)
         col.label(text="Trim Duration:")
-        col.prop(strip, "animation_start_offset", text="Start")
-        col.prop(strip, "animation_end_offset", text="End")
+        col.prop(strip, "frame_offset_start", text="Start")
+        col.prop(strip, "frame_offset_end", text="End")
 
 
 class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel):
@@ -593,7 +595,7 @@
 
     @staticmethod
     def poll(context):
-        if not self.has_sequencer(context):
+        if not __class__.has_sequencer(context):
             return False
 
         strip = act_strip(context)
@@ -634,7 +636,7 @@
 
     @staticmethod
     def poll(context):
-        if not self.has_sequencer(context):
+        if not __class__.has_sequencer(context):
             return False
 
         strip = act_strip(context)
@@ -659,7 +661,7 @@
 
     @staticmethod
     def poll(context):
-        if not self.has_sequencer(context):
+        if not __class__.has_sequencer(context):
             return False
 
         strip = act_strip(context)
@@ -721,7 +723,7 @@
 
     @staticmethod
     def poll(context):
-        if not self.has_sequencer(context):
+        if not __class__.has_sequencer(context):
             return False
 
         strip = act_strip(context)

Modified: trunk/blender/release/scripts/ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d.py	2010-08-05 20:16:38 UTC (rev 31082)
+++ trunk/blender/release/scripts/ui/space_view3d.py	2010-08-05 21:58:57 UTC (rev 31083)
@@ -2253,7 +2253,7 @@
     bl_label = "Properties"
     bl_default_closed = True
 
-    def _active_context_member(self, context):
+    def _active_context_member(context):
         obj = context.object
         if obj:
             mode = obj.mode
@@ -2268,7 +2268,7 @@
 
     @staticmethod
     def poll(context):
-        member = self._active_context_member(context)
+        member = __class__._active_context_member(context)
         if member:
             context_member = getattr(context, member)
             return context_member and context_member.keys()
@@ -2278,7 +2278,7 @@
     def draw(self, context):
         import rna_prop_ui
         # reload(rna_prop_ui)
-        member = self._active_context_member(context)
+        member = __class__._active_context_member(context)
 
         if member:
             # Draw with no edit button





More information about the Bf-blender-cvs mailing list