diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-06-29 21:12:19 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-06-29 21:30:31 +0300 |
commit | fba9cd019f21f29bad1a6f3713370c5172dbc97f (patch) | |
tree | 5c42ca8e6f4d2f7051088306e99676d7e8b47b7b /release | |
parent | ea43ae4194e293599997f1d0d47430b462b4fd7f (diff) |
VSE: Improved Snapping
Change snapping behavior to snap strip edges when they are close to snap point.
Default behavior is, that each transformed strip is snapped to any other strip.
Implement snapping controls in sequencer tool settings. These controls include:
- Snapping on/off
- Ability to snap to playhead and strip hold offset points
- Filter snap points by excluding sound or muted strips
- Control snapping distance
Snapping controls are placed in timeline header similar to 3D viewport
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D11646
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 13a8e46e2b8..ab05461f185 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -162,6 +162,14 @@ class SEQUENCER_HT_header(Header): if tool_settings.use_proportional_edit: row.prop(tool_settings, "proportional_edit_falloff", icon_only=True) + if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}: + tool_settings = context.tool_settings + row = layout.row(align=True) + row.prop(tool_settings, "use_snap_sequencer", text="") + sub = row.row(align=True) + sub.popover(panel="SEQUENCER_PT_snapping") + layout.separator_spacer() + row = layout.row(align=True) row.prop(st, "show_strip_overlay", text="", icon='OVERLAY') sub = row.row(align=True) @@ -2264,6 +2272,30 @@ class SEQUENCER_PT_custom_props(SequencerButtonsPanel, PropertyPanel, Panel): bl_category = "Strip" +class SEQUENCER_PT_snapping(Panel): + bl_space_type = 'SEQUENCE_EDITOR' + bl_region_type = 'HEADER' + bl_label = "" + + def draw(self, context): + tool_settings = context.tool_settings + sequencer_tool_settings = tool_settings.sequencer_tool_settings + + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + col = layout.column(heading="Snap to", align=True) + col.prop(sequencer_tool_settings, "snap_seq_element", expand=True) + + col = layout.column(heading="Ignore", align=True) + col.prop(sequencer_tool_settings, "snap_ignore_muted", text="Muted Strips") + col.prop(sequencer_tool_settings, "snap_ignore_sound",text="Sound Strips") + + col = layout.column() + col.prop(sequencer_tool_settings, "snap_distance", slider=True, text="Distance") + + classes = ( SEQUENCER_MT_change, SEQUENCER_HT_tool_header, @@ -2333,6 +2365,8 @@ classes = ( SEQUENCER_PT_annotation, SEQUENCER_PT_annotation_onion, + + SEQUENCER_PT_snapping, ) if __name__ == "__main__": # only for live edit. |