Making crossfading sounds accessible in the sequencer menu.
authorJoerg Mueller <nexyon@gmail.com>
Wed, 29 Feb 2012 11:23:27 +0000 (11:23 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Wed, 29 Feb 2012 11:23:27 +0000 (11:23 +0000)
release/scripts/startup/bl_operators/sequencer.py
release/scripts/startup/bl_ui/space_sequencer.py

index c51ec74ddd6fea7c0434b2574f33708f3362b3b7..9d055f1bef2de0977fe7daaef693456f36a568d4 100644 (file)
@@ -33,10 +33,20 @@ class SequencerCrossfadeSounds(Operator):
 
     @classmethod
     def poll(cls, context):
-        if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
-            return context.scene.sequence_editor.active_strip.type == 'SOUND'
-        else:
+        seq1 = None
+        seq2 = None
+        for s in context.scene.sequence_editor.sequences:
+            if s.select and s.type == 'SOUND':
+                if seq1 is None:
+                    seq1 = s
+                elif seq2 is None:
+                    seq2 = s
+                else:
+                    return False
+        if seq2 is None:
             return False
+        else:
+            return True
 
     def execute(self, context):
         seq1 = None
index 09af7af08197628db6bee2f08aa9c8315331ba08..723fbd2e3d4f9016b8b50710bd38a2df5abad060 100644 (file)
@@ -264,6 +264,9 @@ class SEQUENCER_MT_strip(Menu):
                 layout.separator()
                 # layout.operator("sequencer.movie_change")
                 layout.operator("sequencer.rendersize")
+            elif stype == 'SOUND':
+                layout.separator()
+                layout.operator("sequencer.crossfade_sounds")
 
         layout.separator()