1
# ##### BEGIN GPL LICENSE BLOCK #####
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
5
# as published by the Free Software Foundation; either version 2
6
# of the License, or (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software Foundation,
15
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
# ##### END GPL LICENSE BLOCK #####
23
from bpy.props import *
26
class SequencerCrossfadeSounds(bpy.types.Operator):
27
'''Do crossfading volume animation of two selected sound strips.'''
29
bl_idname = "sequencer.crossfade_sounds"
30
bl_label = "Crossfade sounds"
31
bl_options = {'REGISTER', 'UNDO'}
33
def poll(self, context):
34
if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
35
return context.scene.sequence_editor.active_strip.type == 'SOUND'
39
def execute(self, context):
42
for s in context.scene.sequence_editor.sequences:
43
if s.select and s.type == 'SOUND':
52
self.report({'ERROR'}, "Select 2 sound strips.")
54
if seq1.frame_final_start > seq2.frame_final_start:
58
if seq1.frame_final_end > seq2.frame_final_start:
59
tempcfra = context.scene.frame_current
60
context.scene.frame_current = seq2.frame_final_start
61
seq1.keyframe_insert('volume')
62
context.scene.frame_current = seq1.frame_final_end
64
seq1.keyframe_insert('volume')
65
seq2.keyframe_insert('volume')
66
context.scene.frame_current = seq2.frame_final_start
68
seq2.keyframe_insert('volume')
69
context.scene.frame_current = tempcfra
72
self.report({'ERROR'}, "The selected strips don't overlap.")
76
class SequencerCutMulticam(bpy.types.Operator):
77
'''Cut multicam strip and select camera.'''
79
bl_idname = "sequencer.cut_multicam"
80
bl_label = "Cut multicam"
81
bl_options = {'REGISTER', 'UNDO'}
83
camera = IntProperty(name="Camera",
84
default=1, min=1, max=32, soft_min=1, soft_max=32)
86
def poll(self, context):
87
if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
88
return context.scene.sequence_editor.active_strip.type == 'MULTICAM'
92
def execute(self, context):
93
camera = self.properties.camera
95
s = context.scene.sequence_editor.active_strip
97
if s.multicam_source == camera or camera >= s.channel:
103
cfra = context.scene.frame_current
104
bpy.ops.sequencer.cut(frame=cfra, type='SOFT', side='RIGHT')
105
for s in context.scene.sequence_editor.sequences_all:
106
if s.select and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
107
context.scene.sequence_editor.active_strip = s
109
context.scene.sequence_editor.active_strip.multicam_source = camera
113
class SequencerDeinterlaceSelectedMovies(bpy.types.Operator):
114
'''Deinterlace all selected movie sources.'''
116
bl_idname = "sequencer.deinterlace_selected_movies"
117
bl_label = "Deinterlace Movies"
118
bl_options = {'REGISTER', 'UNDO'}
120
def poll(self, context):
121
if context.scene and context.scene.sequence_editor:
126
def execute(self, context):
127
for s in context.scene.sequence_editor.sequences_all:
128
if s.select and s.type == 'MOVIE':
129
s.de_interlace = True
135
register = bpy.types.register
137
register(SequencerCrossfadeSounds)
138
register(SequencerCutMulticam)
139
register(SequencerDeinterlaceSelectedMovies)
143
unregister = bpy.types.unregister
145
unregister(SequencerCrossfadeSounds)
146
unregister(SequencerCutMulticam)
147
unregister(SequencerDeinterlaceSelectedMovies)
150
if __name__ == "__main__":