New select operator added.
authorTuri Scandurra <salvatore.scandurra@gmail.com>
Thu, 10 Jan 2013 13:09:05 +0000 (13:09 +0000)
committerTuri Scandurra <salvatore.scandurra@gmail.com>
Thu, 10 Jan 2013 13:09:05 +0000 (13:09 +0000)
sequencer_extra_actions/operators_extra_actions.py
sequencer_extra_actions/ui.py

index 37d0ea66919d64e94265e789794ed77dfdfb1ae6..9ca54c5c8c0e95c3961d067b65d560c0008cfc2a 100644 (file)
@@ -786,6 +786,34 @@ class Sequencer_Extra_SelectCurrentFrame(bpy.types.Operator):
         return {'FINISHED'}
 
 
+# SELECT STRIPS ON SAME CHANNEL
+class Sequencer_Extra_SelectSameChannel(bpy.types.Operator):
+    bl_label = 'Select Strips on the Same Channel'
+    bl_idname = 'sequencerextra.selectsamechannel'
+    bl_description = 'Select strips on the same channel as active one'
+    bl_options = {'REGISTER', 'UNDO'}
+
+    @classmethod
+    def poll(self, context):
+        strip = functions.act_strip(context)
+        scn = context.scene
+        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
+            return True
+        else:
+            return False
+
+    def execute(self, context):
+        scn = context.scene
+        seq = scn.sequence_editor
+        meta_level = len(seq.meta_stack)
+        if meta_level > 0:
+            seq = seq.meta_stack[meta_level - 1]
+        bpy.ops.sequencer.select_active_side(side="LEFT")
+        bpy.ops.sequencer.select_active_side(side="RIGHT")
+
+        return {'FINISHED'}
+
+
 # OPEN IMAGE WITH EXTERNAL EDITOR
 class Sequencer_Extra_EditExternally(bpy.types.Operator):
     bl_label = 'Open with External Editor'
@@ -1875,4 +1903,4 @@ class Sequencer_Extra_ReadExifData(bpy.types.Operator):
         text = bpy.context.active_object
         strip = context.scene.sequence_editor.active_strip
         sce['metadata'] = getexifdata(strip)
-        return {'FINISHED'}
\ No newline at end of file
+        return {'FINISHED'}
index a8bd5bfbb8d91d0550f00814037e271a9a1333a3..15d9fa1a978de59e774fa28548e2c3cbf1a42555 100644 (file)
@@ -52,6 +52,8 @@ def sequencer_select_menu_func(self, context):
     self.layout.operator('sequencerextra.selectcurrentframe',
     text='On Current Frame', icon='PLUGIN').mode = 'ON'
     self.layout.separator()
+    self.layout.operator('sequencerextra.selectsamechannel',
+    text='Same Channel', icon='PLUGIN')
 
 
 def sequencer_strip_menu_func(self, context):
@@ -184,4 +186,4 @@ class ExifInfoPanel(bpy.types.Panel):
             except KeyError:
                 pass
         except AttributeError:
-            pass
\ No newline at end of file
+            pass