[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28535] trunk/blender: == Sequencer ==

Peter Schlaile peter at schlaile.de
Sun May 2 19:36:38 CEST 2010


Revision: 28535
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28535
Author:   schlaile
Date:     2010-05-02 19:36:38 +0200 (Sun, 02 May 2010)

Log Message:
-----------
== Sequencer ==

Made Multicam-Editing really work:
* added a panel within N-keys, so that one can start/stop playback
  and cut between cameras directly from the panel
* made "active_strip" RNA editable, to make that work correctly
  (is usefull anyways :) )

Modified Paths:
--------------
    trunk/blender/release/scripts/op/sequencer.py
    trunk/blender/release/scripts/ui/space_sequencer.py
    trunk/blender/source/blender/makesrna/intern/rna_sequencer.c

Modified: trunk/blender/release/scripts/op/sequencer.py
===================================================================
--- trunk/blender/release/scripts/op/sequencer.py	2010-05-02 14:34:37 UTC (rev 28534)
+++ trunk/blender/release/scripts/op/sequencer.py	2010-05-02 17:36:38 UTC (rev 28535)
@@ -20,6 +20,7 @@
 
 import bpy
 
+from bpy.props import *
 
 class SequencerCrossfadeSounds(bpy.types.Operator):
     '''Do crossfading volume animation of two selected sound strips.'''
@@ -71,12 +72,52 @@
             return {'CANCELLED'}
 
 
+class SequencerCutMulticam(bpy.types.Operator):
+    '''Cut multicam strip and select camera.'''
+
+    bl_idname = "sequencer.cut_multicam"
+    bl_label = "Cut multicam"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    camera = IntProperty(name="Camera",
+            default=1, min=1, max=32, soft_min=1, soft_max=32)
+
+    def poll(self, context):
+        if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
+            return context.scene.sequence_editor.active_strip.type == 'MULTICAM'
+        else:
+            return False
+
+    def execute(self, context):
+        camera = self.properties.camera
+
+        s = context.scene.sequence_editor.active_strip
+
+        if not s.selected:
+            s.selected = True
+            
+        cfra = context.scene.frame_current
+        bpy.ops.sequencer.cut(frame=cfra,type='HARD',side='RIGHT')
+        for s in context.scene.sequence_editor.sequences:
+            if s.selected and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
+                context.scene.sequence_editor.active_strip = s
+                
+        context.scene.sequence_editor.active_strip.multicam_source = camera
+        return {'FINISHED'}
+
+
 def register():
-    bpy.types.register(SequencerCrossfadeSounds)
+    register = bpy.types.register
+    
+    register(SequencerCrossfadeSounds)
+    register(SequencerCutMulticam)
 
 
 def unregister():
-    bpy.types.unregister(SequencerCrossfadeSounds)
+    unregister = bpy.types.unregister
+    
+    unregister(SequencerCrossfadeSounds)
+    unregister(SequencerCutMulticam)
 
 if __name__ == "__main__":
     register()

Modified: trunk/blender/release/scripts/ui/space_sequencer.py
===================================================================
--- trunk/blender/release/scripts/ui/space_sequencer.py	2010-05-02 14:34:37 UTC (rev 28534)
+++ trunk/blender/release/scripts/ui/space_sequencer.py	2010-05-02 17:36:38 UTC (rev 28535)
@@ -19,7 +19,6 @@
 # <pep8 compliant>
 import bpy
 
-
 def act_strip(context):
     try:
         return context.scene.sequence_editor.active_strip
@@ -451,6 +450,19 @@
         elif strip.type == "MULTICAM":
             layout.prop(strip, "multicam_source")
 
+            row = layout.row(align=True)
+            sub = row.row()
+            sub.scale_x = 2.0
+            if not context.screen.animation_playing:
+                sub.operator("screen.animation_play", text="", icon='PLAY')
+            else:
+                sub.operator("screen.animation_play", text="", icon='PAUSE')
+
+            row.label("Cut To")
+            for i in range(1, strip.channel):
+                row.operator("sequencer.cut_multicam", text=str(i)).camera = i
+
+
         col = layout.column(align=True)
         if strip.type == 'SPEED':
             col.prop(strip, "speed_fader", text="Speed fader")

Modified: trunk/blender/source/blender/makesrna/intern/rna_sequencer.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sequencer.c	2010-05-02 14:34:37 UTC (rev 28534)
+++ trunk/blender/source/blender/makesrna/intern/rna_sequencer.c	2010-05-02 17:36:38 UTC (rev 28535)
@@ -804,6 +804,8 @@
 	
 	prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
+	RNA_def_property_flag(prop, PROP_EDITABLE);
+
 	RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
 }
 





More information about the Bf-blender-cvs mailing list