[Bf-blender-cvs] [bea5d9db840] master: UI: Add initial context menu to Sequencer

William Reynish noreply at git.blender.org
Tue May 7 21:07:53 CEST 2019


Commit: bea5d9db840d797cfde9fd6a660bda25795652cb
Author: William Reynish
Date:   Tue May 7 21:07:52 2019 +0200
Branches: master
https://developer.blender.org/rBbea5d9db840d797cfde9fd6a660bda25795652cb

UI: Add initial context menu to Sequencer

Add to both Blender and Industry Compat keymap

===================================================================

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

===================================================================

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index acd3b44de2c..56e1ecb9fdf 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -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)]}),
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 5ca2ecb9b8b..16fc8bc2496 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -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),
     ])
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 7f54276c7e5..f483ada5d44 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -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,



More information about the Bf-blender-cvs mailing list