VSE: Add operators to add and remove fades

Fades add:
Adds or updates a fade animation for either visual or audio strips.
    Fade options:
    - In, Out, In and Out create a fade animation of the given duration from
    the start of the sequence, to the end of the sequence, or on boths sides
    - From playhead: the fade animation goes from the start of sequences under the playhead to the playhead
    - To playhead: the fade animation goes from the playhead to the end of sequences under the playhead
    By default, the duration of the fade is 1 second.

Fades clear:
Removes fade animation from selected sequences.
Removes opacity or volume animation on selected sequences and resets the
property to a value of 1.0. Works on all types of sequences.

Author: gdquest

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D5166
This commit is contained in:
Richard Antalik
2019-09-13 17:24:02 -07:00
parent a960dc4519
commit 2ec025d7be
2 changed files with 250 additions and 4 deletions

View File

@@ -502,6 +502,10 @@ class SEQUENCER_MT_add(Menu):
col.menu("SEQUENCER_MT_add_transitions", icon='ARROW_LEFTRIGHT')
col.enabled = selected_sequences_len(context) >= 2
col = layout.column()
col.operator_menu_enum("sequencer.fades_add", "type", text="Fade", icon="IPO_EASE_IN_OUT")
col.enabled = selected_sequences_len(context) >= 1
class SEQUENCER_MT_add_empty(Menu):
bl_label = "Empty"
@@ -749,26 +753,34 @@ class SEQUENCER_MT_context_menu(Menu):
layout.operator("sequencer.gap_remove").all = False
layout.operator("sequencer.gap_insert")
layout.separator()
strip = act_strip(context)
if strip:
strip_type = strip.type
selected_sequences_count = selected_sequences_len(context)
if strip_type != 'SOUND':
if strip_type != "SOUND":
layout.separator()
layout.operator_menu_enum("sequencer.strip_modifier_add", "type", text="Add Modifier")
layout.operator("sequencer.strip_modifier_copy", text="Copy Modifiers to Selection")
if selected_sequences_len(context) >= 2:
if selected_sequences_count >= 2:
layout.separator()
col = layout.column()
col.menu("SEQUENCER_MT_add_transitions", text="Add Transition")
elif selected_sequences_len(context) >= 2:
elif selected_sequences_count >= 2:
layout.separator()
layout.operator("sequencer.crossfade_sounds", text="Crossfade Sounds")
if selected_sequences_count >= 1:
col = layout.column()
col.operator_menu_enum("sequencer.fades_add", "type", text="Fade")
col.enabled = selected_sequences_len(context) >= 1
layout.operator("sequencer.fades_clear", text="Clear Fade")
if strip_type in {
'CROSS', 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'WIPE', 'GLOW',