blender/release/scripts/op/sequencer.py
Campbell Barton 02da5ecfed Apply first pass of edits to rna values from rna_booleans.txt.
These are not animated and are best not change names like this too late in the release.

ActionGroup.selected -> select:    boolean    Action Group is selected
BezierSplinePoint.hidden -> hide:    boolean    Visibility status
BezierSplinePoint.selected_control_point -> select_control_point:    boolean    Control point selection status
BezierSplinePoint.selected_handle1 -> select_left_handle:    boolean    Handle 1 selection status
BezierSplinePoint.selected_handle2 -> select_right_handle:    boolean    Handle 2 selection status
Bone.restrict_select -> hide_select:    boolean    Bone is able to be selected
Bone.selected -> select:    boolean
CurveMapPoint.selected -> select:    boolean    Selection state of the curve point
EditBone.restrict_select -> hide_select:    boolean    Bone is able to be selected
EditBone.selected -> select:    boolean
EditBone.selected_head -> select_head:    boolean
EditBone.selected_tail -> select_tail:    boolean
EditBone.locked -> lock:    boolean    Bone is not able to be transformed when in Edit Mode
EditBone.hidden -> hide:    boolean    Bone is not visible when in Edit Mode
NEGATE * FCurve.disabled -> enabled:    boolean    F-Curve could not be evaluated in past, so should be skipped when evaluating
FCurve.locked -> lock:    boolean    F-Curve's settings cannot be edited
FCurve.muted -> mute:    boolean    F-Curve is not evaluated
FCurve.selected -> select:    boolean    F-Curve is selected for editing
NEGATE * FCurve.visible -> hide:    boolean    F-Curve and its keyframes are shown in the Graph Editor graphs
FCurveSample.selected -> select:    boolean    Selection status
GPencilFrame.selected -> select:    boolean    Frame is selected for editing in the DopeSheet
GPencilLayer.locked -> lock:    boolean    Protect layer from further editing and/or frame changes
GPencilLayer.selected -> select:    boolean    Layer is selected for editing in the DopeSheet
Keyframe.selected -> select:    boolean    Control point selection status
Keyframe.selected_handle1 -> select_left_handle:    boolean    Handle 1 selection status
Keyframe.selected_handle2 -> select_right_handle:    boolean    Handle 2 selection status
MeshEdge.selected -> select:    boolean
MeshEdge.hidden -> hide:    boolean
MeshFace.hidden -> hide:    boolean
MeshFace.selected -> select:    boolean
MeshVertex.hidden -> hide:    boolean
MeshVertex.selected -> select:    boolean
MotionPathVert.selected -> select:    boolean    Path point is selected for editing
NlaStrip.selected -> select:    boolean    NLA Strip is selected
NlaTrack.locked -> lock:    boolean    NLA Track is locked
NlaTrack.muted -> mute:    boolean    NLA Track is not evaluated
NlaTrack.selected -> select:    boolean    NLA Track is selected
Object.restrict_render -> hide_render:    boolean    Restrict renderability
Object.restrict_select -> hide_select:    boolean    Restrict selection in the viewport
Object.restrict_view -> hide:    boolean    Restrict visibility in the viewport
Object.selected -> select:    boolean    Object selection state
ObjectBase.selected -> select:    boolean    Object base selection state
PoseBone.selected -> select:    boolean
Sequence.right_handle_selected -> select_right_handle:    boolean
Sequence.selected -> select:    boolean
SplinePoint.selected -> select_control_point:    boolean    Selection status
TimelineMarker.selected -> select:    boolean    Marker selection state
Sequence.left_handle_selected -> select_left_handle:    boolean
ActionGroup.locked -> lock:    boolean    Action Group is locked
Bone.hidden -> hide:    boolean    Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)
SplinePoint.hidden -> hide:    boolean    Visibility status
FModifier.muted -> mute:    boolean    F-Curve Modifier will not be evaluated

 note: rebaned uv_select to select_uv
2010-07-15 16:56:04 +00:00

152 lines
4.9 KiB
Python

# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from bpy.props import *
class SequencerCrossfadeSounds(bpy.types.Operator):
'''Do crossfading volume animation of two selected sound strips.'''
bl_idname = "sequencer.crossfade_sounds"
bl_label = "Crossfade sounds"
bl_options = {'REGISTER', 'UNDO'}
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 == 'SOUND'
else:
return False
def execute(self, context):
seq1 = None
seq2 = None
for s in context.scene.sequence_editor.sequences:
if s.select and s.type == 'SOUND':
if seq1 == None:
seq1 = s
elif seq2 == None:
seq2 = s
else:
seq2 = None
break
if seq2 == None:
self.report({'ERROR'}, "Select 2 sound strips.")
return {'CANCELLED'}
if seq1.frame_final_start > seq2.frame_final_start:
s = seq1
seq1 = seq2
seq2 = s
if seq1.frame_final_end > seq2.frame_final_start:
tempcfra = context.scene.frame_current
context.scene.frame_current = seq2.frame_final_start
seq1.keyframe_insert('volume')
context.scene.frame_current = seq1.frame_final_end
seq1.volume = 0
seq1.keyframe_insert('volume')
seq2.keyframe_insert('volume')
context.scene.frame_current = seq2.frame_final_start
seq2.volume = 0
seq2.keyframe_insert('volume')
context.scene.frame_current = tempcfra
return {'FINISHED'}
else:
self.report({'ERROR'}, "The selected strips don't overlap.")
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 s.multicam_source == camera:
return {'FINISHED'}
if not s.select:
s.select = True
cfra = context.scene.frame_current
bpy.ops.sequencer.cut(frame=cfra, type='SOFT', side='RIGHT')
for s in context.scene.sequence_editor.sequences_all:
if s.select 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'}
class SequencerDeinterlaceSelectedMovies(bpy.types.Operator):
'''Deinterlace all selected movie sources.'''
bl_idname = "sequencer.deinterlace_selected_movies"
bl_label = "Deinterlace Movies"
bl_options = {'REGISTER', 'UNDO'}
def poll(self, context):
if context.scene and context.scene.sequence_editor:
return True
else:
return False
def execute(self, context):
for s in context.scene.sequence_editor.sequences_all:
if s.select and s.type == 'MOVIE':
s.de_interlace = True
return {'FINISHED'}
def register():
register = bpy.types.register
register(SequencerCrossfadeSounds)
register(SequencerCutMulticam)
register(SequencerDeinterlaceSelectedMovies)
def unregister():
unregister = bpy.types.unregister
unregister(SequencerCrossfadeSounds)
unregister(SequencerCutMulticam)
unregister(SequencerDeinterlaceSelectedMovies)
if __name__ == "__main__":
register()