diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-09-20 17:21:40 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-09-20 17:30:15 +0300 |
commit | 7cb65e45814db6559ffa48c26b3d000e0f78c4bb (patch) | |
tree | 69794af2edf1d1f18c498b16176c5bed9482250a /release/scripts/startup/bl_ui/space_sequencer.py | |
parent | 9642447faf1054664cf68b302a563c0a1145b7d7 (diff) |
Cleanup: Refactor VSE overlay settings
Move overlay flags into SequencerPreviewOverlay and
SequencerTimelineOverlay structs.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D12569
Diffstat (limited to 'release/scripts/startup/bl_ui/space_sequencer.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 258797c18da..88cf8db686c 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -205,13 +205,14 @@ class SEQUENCER_PT_preview_overlay(Panel): def draw(self, context): ed = context.scene.sequence_editor st = context.space_data + overlay_settings = st.preview_overlay layout = self.layout layout.active = st.show_strip_overlay layout.prop(ed, "show_overlay", text="Frame Overlay") - layout.prop(st, "show_safe_areas", text="Safe Areas") - layout.prop(st, "show_metadata", text="Metadata") - layout.prop(st, "show_annotation", text="Annotations") + layout.prop(overlay_settings, "show_safe_areas", text="Safe Areas") + layout.prop(overlay_settings, "show_metadata", text="Metadata") + layout.prop(overlay_settings, "show_annotation", text="Annotations") class SEQUENCER_PT_sequencer_overlay(Panel): @@ -227,23 +228,24 @@ class SEQUENCER_PT_sequencer_overlay(Panel): def draw(self, context): st = context.space_data + overlay_settings = st.timeline_overlay layout = self.layout layout.active = st.show_strip_overlay - layout.prop(st, "show_strip_name", text="Name") - layout.prop(st, "show_strip_source", text="Source") - layout.prop(st, "show_strip_duration", text="Duration") + layout.prop(overlay_settings, "show_strip_name", text="Name") + layout.prop(overlay_settings, "show_strip_source", text="Source") + layout.prop(overlay_settings, "show_strip_duration", text="Duration") layout.separator() - layout.prop(st, "show_strip_offset", text="Offsets") - layout.prop(st, "show_fcurves", text="F-Curves") - layout.prop(st, "show_grid", text="Grid") + layout.prop(overlay_settings, "show_strip_offset", text="Offsets") + layout.prop(overlay_settings, "show_fcurves", text="F-Curves") + layout.prop(overlay_settings, "show_grid", text="Grid") layout.separator() - layout.prop_menu_enum(st, "waveform_display_type") + layout.prop_menu_enum(overlay_settings, "waveform_display_type") class SEQUENCER_MT_view_cache(Menu): @@ -1652,6 +1654,7 @@ class SEQUENCER_PT_adjust_sound(SequencerButtonsPanel, Panel): layout.use_property_split = False st = context.space_data + overlay_settings = st.timeline_overlay strip = context.active_sequence_strip sound = strip.sound @@ -1663,7 +1666,7 @@ class SEQUENCER_PT_adjust_sound(SequencerButtonsPanel, Panel): split = col.split(factor=0.4) split.label(text="") split.prop(sound, "use_mono") - if st.waveform_display_type == 'DEFAULT_WAVEFORMS': + if overlay_settings.waveform_display_type == 'DEFAULT_WAVEFORMS': split = col.split(factor=0.4) split.label(text="") split.prop(strip, "show_waveform") @@ -2090,17 +2093,16 @@ class SEQUENCER_PT_view_safe_areas(SequencerButtonsPanel_Output, Panel): return is_preview and (st.display_mode == 'IMAGE') def draw_header(self, context): - st = context.space_data - - self.layout.prop(st, "show_safe_areas", text="") + overlay_settings = context.space_data.preview_overlay + self.layout.prop(overlay_settings, "show_safe_areas", text="") def draw(self, context): layout = self.layout layout.use_property_split = True - st = context.space_data + overlay_settings = context.space_data.preview_overlay safe_data = context.scene.safe_areas - layout.active = st.show_safe_areas + layout.active = overlay_settings.show_safe_areas col = layout.column() @@ -2116,19 +2118,18 @@ class SEQUENCER_PT_view_safe_areas_center_cut(SequencerButtonsPanel_Output, Pane bl_category = "View" def draw_header(self, context): - st = context.space_data - layout = self.layout - layout.active = st.show_safe_areas - layout.prop(st, "show_safe_center", text="") + overlay_settings = context.space_data.preview_overlay + layout.active = overlay_settings.show_safe_areas + layout.prop(overlay_settings, "show_safe_center", text="") def draw(self, context): layout = self.layout layout.use_property_split = True safe_data = context.scene.safe_areas - st = context.space_data + overlay_settings = context.space_data.preview_overlay - layout.active = st.show_safe_areas and st.show_safe_center + layout.active = overlay_settings.show_safe_areas and overlay_settings.show_safe_center col = layout.column() col.prop(safe_data, "title_center", slider=True) |