diff options
author | Colin Basnett <cmbasnett> | 2022-04-14 12:30:12 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-04-14 12:30:12 +0300 |
commit | f1ae6952a86ba1b74e0b4a9d50e83d41b2019d1a (patch) | |
tree | debbbfc0872a01ee18b21848f97f662413828672 /release | |
parent | d6e72412373e2f90969b2f2a6ecfcb420011784b (diff) |
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
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_nla.py | 18 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_time.py | 4 |
2 files changed, 22 insertions, 0 deletions
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() |