Merge branch 'blender-v4.2-release'

This commit is contained in:
Richard Antalik
2024-06-26 06:12:39 +02:00
2 changed files with 25 additions and 14 deletions

View File

@@ -16,6 +16,15 @@ from bpy.props import (
from bpy.app.translations import pgettext_rpt as rpt_
def _animated_properties_get(sequence):
animated_properties = []
if hasattr(sequence, "volume"):
animated_properties.append("volume")
if hasattr(sequence, "blend_alpha"):
animated_properties.append("blend_alpha")
return animated_properties
class SequencerCrossfadeSounds(Operator):
"""Do cross-fading volume animation of two selected sound strips"""
@@ -150,12 +159,12 @@ class SequencerFadesClear(Operator):
if curve.data_path.startswith("sequence_editor.sequences_all")
}
for sequence in context.selected_sequences:
animated_property = "volume" if hasattr(sequence, "volume") else "blend_alpha"
data_path = sequence.path_from_id() + "." + animated_property
curve = fcurve_map.get(data_path)
if curve:
fcurves.remove(curve)
setattr(sequence, animated_property, 1.0)
for animated_property in _animated_properties_get(sequence):
data_path = sequence.path_from_id() + "." + animated_property
curve = fcurve_map.get(data_path)
if curve:
fcurves.remove(curve)
setattr(sequence, animated_property, 1.0)
sequence.invalidate_cache('COMPOSITE')
return {'FINISHED'}
@@ -230,11 +239,11 @@ class SequencerFadesAdd(Operator):
if not self.is_long_enough(sequence, duration):
continue
animated_property = "volume" if hasattr(sequence, "volume") else "blend_alpha"
fade_fcurve = self.fade_find_or_create_fcurve(context, sequence, animated_property)
fades = self.calculate_fades(sequence, fade_fcurve, animated_property, duration)
self.fade_animation_clear(fade_fcurve, fades)
self.fade_animation_create(fade_fcurve, fades)
for animated_property in _animated_properties_get(sequence):
fade_fcurve = self.fade_find_or_create_fcurve(context, sequence, animated_property)
fades = self.calculate_fades(sequence, fade_fcurve, animated_property, duration)
self.fade_animation_clear(fade_fcurve, fades)
self.fade_animation_create(fade_fcurve, fades)
faded_sequences.append(sequence)
sequence.invalidate_cache('COMPOSITE')

View File

@@ -573,7 +573,7 @@ class SEQUENCER_MT_select(Menu):
def draw(self, context):
layout = self.layout
st = context.space_data
has_sequencer, _has_preview = _space_view_types(st)
has_sequencer, has_preview = _space_view_types(st)
is_retiming = context.scene.sequence_editor.selected_retiming_keys
layout.operator("sequencer.select_all", text="All").action = 'SELECT'
@@ -582,12 +582,14 @@ class SEQUENCER_MT_select(Menu):
layout.separator()
layout.operator("sequencer.select_box", text="Box Select")
col = layout.column()
if has_sequencer:
col.operator("sequencer.select_box", text="Box Select")
props = col.operator("sequencer.select_box", text="Box Select (Include Handles)")
props.include_handles = True
elif has_preview:
col.operator_context = 'INVOKE_REGION_PREVIEW'
col.operator("sequencer.select_box", text="Box Select")
col.separator()