[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1764] contrib/py/scripts/addons/ sequencer_select_strips_by_type: Sequencer Select Strips By Type - 0.0.3

Bastien Montagne montagne29 at wanadoo.fr
Fri Apr 1 19:08:06 CEST 2011


Revision: 1764
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1764
Author:   mont29
Date:     2011-04-01 17:08:05 +0000 (Fri, 01 Apr 2011)
Log Message:
-----------
Sequencer Select Strips By Type - 0.0.3
* Just made it pep8 compliant?\226?\128?\166

Modified Paths:
--------------
    contrib/py/scripts/addons/sequencer_select_strips_by_type/__init__.py
    contrib/py/scripts/addons/sequencer_select_strips_by_type/menu.py
    contrib/py/scripts/addons/sequencer_select_strips_by_type/operator.py

Modified: contrib/py/scripts/addons/sequencer_select_strips_by_type/__init__.py
===================================================================
--- contrib/py/scripts/addons/sequencer_select_strips_by_type/__init__.py	2011-04-01 14:20:47 UTC (rev 1763)
+++ contrib/py/scripts/addons/sequencer_select_strips_by_type/__init__.py	2011-04-01 17:08:05 UTC (rev 1764)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
 # ##### BEGIN GPL LICENSE BLOCK #####
 #
 #  This program is free software; you can redistribute it and/or
@@ -34,8 +36,15 @@
 #
 # ##### END OF CHANGELOG #####
 
+# <pep8 compliant>
+
+"""
+This Blender addon simply adds two options in the sequencer Select menu, to (de)select strips
+by type.
+"""
+
 bl_info = {
-    "name": "Sequencer Select Strips By Type",
+    "name": "Select Strips By Type",
     "author": "Bastien Montagne",
     "version": (0, 0, 3),
     "blender": (2, 5, 6),
@@ -59,12 +68,14 @@
     from . import operator
     from . import menu
 
+
 def register():
     bpy.utils.register_module(__name__)
 
     # Append the relevant menu entries.
     bpy.types.SEQUENCER_MT_select.append(menu.menu_func)
 
+
 def unregister():
     bpy.utils.unregister_module(__name__)
 
@@ -73,4 +84,3 @@
 
 if __name__ == "__main__":
     register()
-

Modified: contrib/py/scripts/addons/sequencer_select_strips_by_type/menu.py
===================================================================
--- contrib/py/scripts/addons/sequencer_select_strips_by_type/menu.py	2011-04-01 14:20:47 UTC (rev 1763)
+++ contrib/py/scripts/addons/sequencer_select_strips_by_type/menu.py	2011-04-01 17:08:05 UTC (rev 1764)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
 # ##### BEGIN GPL LICENSE BLOCK #####
 #
 #  This program is free software; you can redistribute it and/or
@@ -16,8 +18,11 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 
+
 # Selection.
 class SEQUENCER_MT_select_by_type(bpy.types.Menu):
     """
@@ -32,7 +37,7 @@
         layout.operator("sequencer.select_by_type", text="All Graphical Strips").select_types = {
                 "CROSS", "ADD", "SUBTRACT", "ALPHA_OVER", "ALPHA_UNDER", "GAMMA_CROSS", "MULTIPLY",
                 "OVER_DROP", "PLUGIN", "WIPE", "GLOW", "TRANSFORM", "COLOR", "SPEED", "IMAGE",
-                "MOVIE", "SCENE", "META"} # META might be graphical…
+                "MOVIE", "SCENE", "META"}  # META might be graphical…
         layout.operator("sequencer.select_by_type", text="All Effect Strips").select_types = {
                 "CROSS", "ADD", "SUBTRACT", "ALPHA_OVER", "ALPHA_UNDER", "GAMMA_CROSS", "MULTIPLY",
                 "OVER_DROP", "PLUGIN", "WIPE", "GLOW", "TRANSFORM", "COLOR", "SPEED"}
@@ -41,11 +46,12 @@
         layout.operator("sequencer.select_by_type", text="Image Strips").select_types = {"IMAGE"}
         layout.operator("sequencer.select_by_type", text="Scene Strips").select_types = {"SCENE"}
         layout.operator("sequencer.select_by_type", text="Sound Strips").select_types = {"SOUND"}
-        layout.operator("sequencer.select_by_type", text="Meta Strips").select_types  = {"META"}
+        layout.operator("sequencer.select_by_type", text="Meta Strips").select_types = {"META"}
 
         layout.separator()
         layout.menu("SEQUENCER_MT_select_by_type_effects")
 
+
 class SEQUENCER_MT_select_by_type_effects(bpy.types.Menu):
     """
     Sub-menu to select effect strips by types.
@@ -56,21 +62,22 @@
         layout = self.layout
 
         layout.column()
-        layout.operator("sequencer.select_by_type", text="Add").select_types         = {"ADD"}
-        layout.operator("sequencer.select_by_type", text="Subtract").select_types    = {"SUBTRACT"}
-        layout.operator("sequencer.select_by_type", text="Multiply").select_types    = {"MULTIPLY"}
-        layout.operator("sequencer.select_by_type", text="Alpha Over").select_types  = {"ALPHA_OVER"}
+        layout.operator("sequencer.select_by_type", text="Add").select_types = {"ADD"}
+        layout.operator("sequencer.select_by_type", text="Subtract").select_types = {"SUBTRACT"}
+        layout.operator("sequencer.select_by_type", text="Multiply").select_types = {"MULTIPLY"}
+        layout.operator("sequencer.select_by_type", text="Alpha Over").select_types = {"ALPHA_OVER"}
         layout.operator("sequencer.select_by_type", text="Alpha Under").select_types = {"ALPHA_UNDER"}
-        layout.operator("sequencer.select_by_type", text="Over Drop").select_types   = {"OVER_DROP"}
-        layout.operator("sequencer.select_by_type", text="Cross").select_types       = {"CROSS"}
+        layout.operator("sequencer.select_by_type", text="Over Drop").select_types = {"OVER_DROP"}
+        layout.operator("sequencer.select_by_type", text="Cross").select_types = {"CROSS"}
         layout.operator("sequencer.select_by_type", text="Gamma Cross").select_types = {"GAMMA_CROSS"}
-        layout.operator("sequencer.select_by_type", text="Wipe").select_types        = {"WIPE"}
-        layout.operator("sequencer.select_by_type", text="Glow").select_types        = {"GLOW"}
-        layout.operator("sequencer.select_by_type", text="Transform").select_types   = {"TRANSFORM"}
-        layout.operator("sequencer.select_by_type", text="Color").select_types       = {"COLOR"}
-        layout.operator("sequencer.select_by_type", text="Speed").select_types       = {"SPEED"}
-        layout.operator("sequencer.select_by_type", text="Plugin").select_types      = {"PLUGIN"}
+        layout.operator("sequencer.select_by_type", text="Wipe").select_types = {"WIPE"}
+        layout.operator("sequencer.select_by_type", text="Glow").select_types = {"GLOW"}
+        layout.operator("sequencer.select_by_type", text="Transform").select_types = {"TRANSFORM"}
+        layout.operator("sequencer.select_by_type", text="Color").select_types = {"COLOR"}
+        layout.operator("sequencer.select_by_type", text="Speed").select_types = {"SPEED"}
+        layout.operator("sequencer.select_by_type", text="Plugin").select_types = {"PLUGIN"}
 
+
 # Deselection
 class SEQUENCER_MT_deselect_by_type(bpy.types.Menu):
     """
@@ -85,7 +92,7 @@
         me = layout.operator("sequencer.select_by_type", text="All Graphical Strips")
         me.select_types = {"CROSS", "ADD", "SUBTRACT", "ALPHA_OVER", "ALPHA_UNDER", "GAMMA_CROSS",
                 "MULTIPLY", "OVER_DROP", "PLUGIN", "WIPE", "GLOW", "TRANSFORM", "COLOR", "SPEED",
-                "IMAGE", "MOVIE", "SCENE", "META"} # META might be graphical…
+                "IMAGE", "MOVIE", "SCENE", "META"}  # META might be graphical…
         me.deselect = True
         me = layout.operator("sequencer.select_by_type", text="All Effect Strips")
         me.select_types = {"CROSS", "ADD", "SUBTRACT", "ALPHA_OVER", "ALPHA_UNDER", "GAMMA_CROSS",
@@ -105,12 +112,13 @@
         me.select_types = {"SOUND"}
         me.deselect = True
         me = layout.operator("sequencer.select_by_type", text="Meta Strips")
-        me.select_types  = {"META"}
+        me.select_types = {"META"}
         me.deselect = True
 
         layout.separator()
         layout.menu("SEQUENCER_MT_deselect_by_type_effects")
 
+
 class SEQUENCER_MT_deselect_by_type_effects(bpy.types.Menu):
     """
     Sub-menu to deselect effect strips by types.
@@ -164,9 +172,9 @@
         me.select_types = {"PLUGIN"}
         me.deselect = True
 
+
 def menu_func(self, context):
     layout = self.layout
     layout.separator()
     layout.menu("SEQUENCER_MT_select_by_type")
     layout.menu("SEQUENCER_MT_deselect_by_type")
-

Modified: contrib/py/scripts/addons/sequencer_select_strips_by_type/operator.py
===================================================================
--- contrib/py/scripts/addons/sequencer_select_strips_by_type/operator.py	2011-04-01 14:20:47 UTC (rev 1763)
+++ contrib/py/scripts/addons/sequencer_select_strips_by_type/operator.py	2011-04-01 17:08:05 UTC (rev 1764)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
 # ##### BEGIN GPL LICENSE BLOCK #####
 #
 #  This program is free software; you can redistribute it and/or
@@ -16,19 +18,25 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 
+
 def main(context, select_types, deselect):
     # Simply check all strips in the sequencer and select those of given type(s)
     # and not yet selected…
     # If deselect is True, remove them from selection instead!
     for seq in context.sequences:
         if seq.type in select_types:
-            if not deselect and not seq.select: seq.select = True
-            elif seq.select: seq.select = False
+            if not deselect and not seq.select:
+                seq.select = True
+            elif seq.select:
+                seq.select = False
 
 from bpy.props import BoolProperty, EnumProperty
 
+
 class SelectSequenceStripsByType(bpy.types.Operator):
     '''
     (De)select sequence strips by type.
@@ -80,4 +88,3 @@
 
 if __name__ == "__main__":
     bpy.ops.sequencer.select_by_type()
-



More information about the Bf-extensions-cvs mailing list