UI: Add initial context menu to Sequencer
authorWilliam Reynish <billrey@me.com>
Tue, 7 May 2019 19:07:52 +0000 (21:07 +0200)
committerWilliam Reynish <billrey@me.com>
Tue, 7 May 2019 19:07:52 +0000 (21:07 +0200)
Add to both Blender and Industry Compat keymap

release/scripts/presets/keyconfig/keymap_data/blender_default.py
release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
release/scripts/startup/bl_ui/space_sequencer.py

index acd3b44..56e1ecb 100644 (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)]}),
index 5ca2ecb..16fc8bc 100644 (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),
     ])
index 7f54276..f483ada 100644 (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,