[Durian-svn] [1691] fix for sequencer slide canceling

campbell institute at blender.org
Fri Apr 2 12:03:18 CEST 2010


Revision: 1691
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=1691
Author:   campbell
Date:     2010-04-02 12:03:18 +0200 (Fri, 02 Apr 2010)
Log Message:
-----------
fix for sequencer slide canceling

Modified Paths:
--------------
    pro/scripts/ui/sequencer_slide.py

Modified: pro/scripts/ui/sequencer_slide.py
===================================================================
--- pro/scripts/ui/sequencer_slide.py	2010-04-02 09:44:57 UTC (rev 1690)
+++ pro/scripts/ui/sequencer_slide.py	2010-04-02 10:03:18 UTC (rev 1691)
@@ -7,22 +7,27 @@
     bl_label = "Sequencer Slide Inverse"
 
     first_mouse_x = IntProperty()
-
+    
+    def _apply_delta(self, delta):
+        for strip, channel, start, final_start, final_end in self.strip_info:
+            strip.frame_start = start - delta
+            strip.frame_final_start = final_start
+            strip.frame_final_end = final_end
+            strip.channel = channel # incase its moved about
+    
     def modal(self, context, event):
         if event.type == 'MOUSEMOVE':
-            delta = self.properties.first_mouse_x - event.mouse_x
-            for strip, start, final_start, final_end in self.strip_info:
-                strip.frame_start = start - delta
-                strip.frame_final_start = final_start
-                strip.frame_final_end = final_end
-
+            self._apply_delta(self.properties.first_mouse_x - event.mouse_x)
+        elif event.type in ('RIGHTMOUSE', 'ESC'):
+            self._apply_delta(0)
+            return {'FINISHED'}
         elif event.type == 'LEFTMOUSE':
             return {'FINISHED'}
 
         return {'RUNNING_MODAL'}
 
     def invoke(self, context, event):
-        self.strip_info = [(strip, strip.frame_start, strip.frame_final_start, strip.frame_final_end) for strip in context.scene.sequence_editor.sequences if strip.selected]
+        self.strip_info = [(strip, strip.channel, strip.frame_start, strip.frame_final_start, strip.frame_final_end) for strip in context.scene.sequence_editor.sequences if strip.selected]
             
         if context.scene:
             context.manager.add_modal_handler(self)



More information about the Durian-svn mailing list