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 #####
22
from bpy.types import Operator
24
from bpy.props import IntProperty
27
class SequencerCrossfadeSounds(Operator):
28
'''Do cross-fading volume animation of two selected sound strips'''
30
bl_idname = "sequencer.crossfade_sounds"
31
bl_label = "Crossfade sounds"
32
bl_options = {'REGISTER', 'UNDO'}
35
def poll(cls, context):
36
if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
37
return context.scene.sequence_editor.active_strip.type == 'SOUND'
41
def execute(self, context):
44
for s in context.scene.sequence_editor.sequences:
45
if s.select and s.type == 'SOUND':
54
self.report({'ERROR'}, "Select 2 sound strips")
56
if seq1.frame_final_start > seq2.frame_final_start:
60
if seq1.frame_final_end > seq2.frame_final_start:
61
tempcfra = context.scene.frame_current
62
context.scene.frame_current = seq2.frame_final_start
63
seq1.keyframe_insert("volume")
64
context.scene.frame_current = seq1.frame_final_end
66
seq1.keyframe_insert("volume")
67
seq2.keyframe_insert("volume")
68
context.scene.frame_current = seq2.frame_final_start
70
seq2.keyframe_insert("volume")
71
context.scene.frame_current = tempcfra
74
self.report({'ERROR'}, "The selected strips don't overlap")
78
class SequencerCutMulticam(Operator):
79
'''Cut multi-cam strip and select camera'''
81
bl_idname = "sequencer.cut_multicam"
82
bl_label = "Cut multicam"
83
bl_options = {'REGISTER', 'UNDO'}
88
soft_min=1, soft_max=32,
93
def poll(cls, context):
94
if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
95
return context.scene.sequence_editor.active_strip.type == 'MULTICAM'
99
def execute(self, context):
102
s = context.scene.sequence_editor.active_strip
104
if s.multicam_source == camera or camera >= s.channel:
110
cfra = context.scene.frame_current
111
bpy.ops.sequencer.cut(frame=cfra, type='SOFT', side='RIGHT')
112
for s in context.scene.sequence_editor.sequences_all:
113
if s.select and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
114
context.scene.sequence_editor.active_strip = s
116
context.scene.sequence_editor.active_strip.multicam_source = camera
120
class SequencerDeinterlaceSelectedMovies(Operator):
121
'''Deinterlace all selected movie sources'''
123
bl_idname = "sequencer.deinterlace_selected_movies"
124
bl_label = "Deinterlace Movies"
125
bl_options = {'REGISTER', 'UNDO'}
128
def poll(cls, context):
129
if context.scene and context.scene.sequence_editor:
134
def execute(self, context):
135
for s in context.scene.sequence_editor.sequences_all:
136
if s.select and s.type == 'MOVIE':
137
s.use_deinterlace = True