UI: Add initial context menu to Sequencer

Add to both Blender and Industry Compat keymap
This commit is contained in:
2019-05-07 21:07:52 +02:00
parent 9b4a57f74c
commit bea5d9db84
3 changed files with 63 additions and 0 deletions

View File

@@ -2435,6 +2435,7 @@ def km_sequencer(params):
("sequencer.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
op_menu("SEQUENCER_MT_add", {"type": 'A', "value": 'PRESS', "shift": True}),
op_menu("SEQUENCER_MT_change", {"type": 'C', "value": 'PRESS'}),
op_menu("SEQUENCER_MT_channel_context_menu", params.context_menu_event),
("sequencer.slip", {"type": 'S', "value": 'PRESS'}, None),
("wm.context_set_int", {"type": 'O', "value": 'PRESS'},
{"properties": [("data_path", 'scene.sequence_editor.overlay_frame'), ("value", 0)]}),

View File

@@ -1766,6 +1766,7 @@ def km_sequencer(params):
("transform.seq_slide", {"type": 'EVT_TWEAK_M', "value": 'ANY'}, None),
("transform.transform", {"type": 'E', "value": 'PRESS'},
{"properties": [("mode", 'TIME_EXTEND')]}),
op_menu("SEQUENCER_MT_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
("marker.add", {"type": 'M', "value": 'PRESS'}, None),
("marker.rename", {"type": 'RET', "value": 'PRESS'}, None),
])

View File

@@ -598,6 +598,66 @@ class SEQUENCER_MT_strip(Menu):
layout.menu("SEQUENCER_MT_strip_lock_mute")
class SEQUENCER_MT_context_menu(Menu):
bl_label = "Sequencer Context Menu"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.copy", text="Copy")
layout.operator("sequencer.paste", text="Paste")
layout.operator("sequencer.duplicate_move")
layout.operator("sequencer.delete", text="Delete...")
layout.separator()
layout.operator("sequencer.cut", text="Cut (Hard) at frame").type = 'HARD'
layout.operator("sequencer.cut", text="Cut (Soft) at frame").type = 'SOFT'
layout.separator()
layout.operator("sequencer.snap")
layout.operator("sequencer.offset_clear")
strip = act_strip(context)
if strip:
stype = strip.type
if stype in {
'CROSS', 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'WIPE', 'GLOW',
'TRANSFORM', 'COLOR', 'SPEED', 'MULTICAM', 'ADJUSTMENT',
'GAUSSIAN_BLUR', 'TEXT',
}:
layout.separator()
layout.operator_menu_enum("sequencer.change_effect_input", "swap")
layout.operator_menu_enum("sequencer.change_effect_type", "type")
layout.operator("sequencer.reassign_inputs")
layout.operator("sequencer.swap_inputs")
elif stype in {'IMAGE', 'MOVIE'}:
layout.separator()
layout.operator("sequencer.rendersize")
layout.operator("sequencer.images_separate")
elif stype == 'SOUND':
layout.separator()
layout.operator("sequencer.crossfade_sounds")
elif stype == 'META':
layout.separator()
layout.operator("sequencer.meta_separate")
layout.separator()
layout.operator("sequencer.meta_make")
layout.separator()
layout.menu("SEQUENCER_MT_strip_input")
class SequencerButtonsPanel:
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
@@ -1486,6 +1546,7 @@ classes = (
SEQUENCER_MT_strip_transform,
SEQUENCER_MT_strip_input,
SEQUENCER_MT_strip_lock_mute,
SEQUENCER_MT_context_menu,
SEQUENCER_PT_edit,
SEQUENCER_PT_effect,
SEQUENCER_PT_input,