From f1ae6952a86ba1b74e0b4a9d50e83d41b2019d1a Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Thu, 14 Apr 2022 11:30:12 +0200 Subject: Animation: Select markers before/after current frame Add operator to select markers left/right of the current frame (including the current frame). `bpy.ops.marker.select_leftright(mode='LEFT', extend=False)` `mode` can be either 'LEFT' or 'RIGHT'. The naming and defaults of the above variables match similar operators (e.g., `bpy.ops.nla.select_leftright`) This also adds a new sub-menu to the Marker menu found in animation editors, exposing both the new `bpy.ops.marker.select_leftright` operator as well as the `bpy.ops.marker.select_all` operator. Despite the name "Before Current Frame" and "After Current Frame", it also selects a marker that falls on the current from for both of the modes. This is to match the behavior found in the `nla.select_leftright` operator. RCS: https://blender.community/c/rightclickselect/OgmG/ Reviewed by: sybren, looch Differential Revision: https://developer.blender.org/D14176 --- release/scripts/startup/bl_ui/space_nla.py | 18 ++++++++++++++++++ release/scripts/startup/bl_ui/space_time.py | 4 ++++ 2 files changed, 22 insertions(+) (limited to 'release/scripts/startup/bl_ui') diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py index 99324ac5d50..961d6525a69 100644 --- a/release/scripts/startup/bl_ui/space_nla.py +++ b/release/scripts/startup/bl_ui/space_nla.py @@ -150,6 +150,23 @@ class NLA_MT_marker(Menu): marker_menu_generic(layout, context) +class NLA_MT_marker_select(Menu): + bl_label = 'Select' + + def draw(self, context): + layout = self.layout + + layout.operator("marker.select_all", text="All").action = 'SELECT' + layout.operator("marker.select_all", text="None").action = 'DESELECT' + layout.operator("marker.select_all", text="Invert").action = 'INVERT' + + layout.separator() + + layout.operator("marker.select_leftright", text="Before Current Frame").mode = 'LEFT' + layout.operator("marker.select_leftright", text="After Current Frame").mode = 'RIGHT' + + + class NLA_MT_edit(Menu): bl_label = "Edit" @@ -312,6 +329,7 @@ classes = ( NLA_MT_view, NLA_MT_select, NLA_MT_marker, + NLA_MT_marker_select, NLA_MT_add, NLA_MT_edit_transform, NLA_MT_snap_pie, diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index b5b124253f3..13ab6e67b00 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -194,6 +194,10 @@ def marker_menu_generic(layout, context): layout.separator() + layout.menu('NLA_MT_marker_select') + + layout.separator() + layout.operator("marker.camera_bind") layout.separator() -- cgit v1.2.3