== 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 :) )
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
from bpy.props import *
|
||||||
|
|
||||||
class SequencerCrossfadeSounds(bpy.types.Operator):
|
class SequencerCrossfadeSounds(bpy.types.Operator):
|
||||||
'''Do crossfading volume animation of two selected sound strips.'''
|
'''Do crossfading volume animation of two selected sound strips.'''
|
||||||
@@ -71,12 +72,52 @@ class SequencerCrossfadeSounds(bpy.types.Operator):
|
|||||||
return {'CANCELLED'}
|
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():
|
def register():
|
||||||
bpy.types.register(SequencerCrossfadeSounds)
|
register = bpy.types.register
|
||||||
|
|
||||||
|
register(SequencerCrossfadeSounds)
|
||||||
|
register(SequencerCutMulticam)
|
||||||
|
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
bpy.types.unregister(SequencerCrossfadeSounds)
|
unregister = bpy.types.unregister
|
||||||
|
|
||||||
|
unregister(SequencerCrossfadeSounds)
|
||||||
|
unregister(SequencerCutMulticam)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
register()
|
register()
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
|
||||||
def act_strip(context):
|
def act_strip(context):
|
||||||
try:
|
try:
|
||||||
return context.scene.sequence_editor.active_strip
|
return context.scene.sequence_editor.active_strip
|
||||||
@@ -451,6 +450,19 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
|
|||||||
elif strip.type == "MULTICAM":
|
elif strip.type == "MULTICAM":
|
||||||
layout.prop(strip, "multicam_source")
|
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)
|
col = layout.column(align=True)
|
||||||
if strip.type == 'SPEED':
|
if strip.type == 'SPEED':
|
||||||
col.prop(strip, "speed_fader", text="Speed fader")
|
col.prop(strip, "speed_fader", text="Speed fader")
|
||||||
|
@@ -804,6 +804,8 @@ static void rna_def_editor(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
|
prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
|
||||||
RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
|
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");
|
RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user