diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_sequencer.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 194 |
1 files changed, 140 insertions, 54 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index d5ef24d7ff3..f12dff248ed 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -185,6 +185,27 @@ class SEQUENCER_MT_range(Menu): layout.operator("anim.end_frame_set", text="Set End Frame") +class SEQUENCER_MT_preview_zoom(Menu): + bl_label = "Fractional Zoom" + + def draw(self, context): + layout = self.layout + layout.operator_context = 'INVOKE_REGION_PREVIEW' + + ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1)) + + for i, (a, b) in enumerate(ratios): + if i in {3, 4}: # Draw separators around Zoom 1:1. + layout.separator() + + layout.operator( + "sequencer.view_zoom_ratio", + text=iface_(f"Zoom {a:d}:{b:d}"), + translate=False, + ).ratio = a / b + layout.operator_context = 'INVOKE_DEFAULT' + + class SEQUENCER_MT_view(Menu): bl_label = "View" @@ -194,6 +215,8 @@ class SEQUENCER_MT_view(Menu): st = context.space_data is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'} is_sequencer_view = st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'} + scene = context.scene + ed = scene.sequence_editor if st.view_type == 'PREVIEW': # Specifying the REGION_PREVIEW context is needed in preview-only @@ -214,6 +237,21 @@ class SEQUENCER_MT_view(Menu): layout.operator("sequencer.view_all", text="Frame All") layout.operator("view2d.zoom_border", text="Zoom") + if is_preview: + layout.operator_context = 'INVOKE_REGION_PREVIEW' + layout.separator() + + layout.operator("sequencer.view_all_preview", text="Fit Preview in Window") + + if is_sequencer_view: + layout.menu("SEQUENCER_MT_preview_zoom", text="Fractional Preview Zoom") + else: + layout.operator("view2d.zoom_border", text="Zoom") + layout.menu("SEQUENCER_MT_preview_zoom") + + layout.operator_context = 'INVOKE_DEFAULT' + + if is_sequencer_view: layout.separator() layout.operator_context = 'INVOKE_DEFAULT' @@ -227,47 +265,26 @@ class SEQUENCER_MT_view(Menu): layout.separator() layout.operator_context = 'INVOKE_DEFAULT' - if is_preview: - layout.operator_context = 'INVOKE_REGION_PREVIEW' - layout.operator("sequencer.view_all_preview", text="Fit Preview in window") - layout.operator("view2d.zoom_border", text="Zoom") - - layout.separator() - - ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1)) - - for a, b in ratios: - layout.operator( - "sequencer.view_zoom_ratio", - text=iface_("Zoom %d:%d") % (a, b), - translate=False, - ).ratio = a / b +# layout.prop(st, "show_frame_indicator") #Do not have any function and do not work. + layout.prop(st, "show_strip_offset") + layout.prop(st, "show_marker_lines") + if is_preview: layout.separator() - - layout.operator_context = 'INVOKE_DEFAULT' - - # # XXX, invokes in the header view - # layout.operator("sequencer.view_ghost_border", text="Overlay Border") + if st.display_mode == 'IMAGE': + layout.prop(ed, "show_overlay", text="Show Frame Overlay") + layout.prop(st, "show_safe_areas", text="Show Safe Areas") + layout.prop(st, "show_metadata", text="Show Metadata") + layout.prop(st, "show_annotation", text="Show Annotations") + elif st.display_mode == 'WAVEFORM': + layout.prop(st, "show_separate_color", text="Show Separate Color Channels") if is_sequencer_view: - layout.prop(st, "show_seconds") - layout.prop(st, "show_frame_indicator") - layout.prop(st, "show_strip_offset") - layout.prop(st, "show_marker_lines") - layout.separator() layout.menu("SEQUENCER_MT_view_cache") layout.prop_menu_enum(st, "waveform_display_type") - if is_preview: - if st.display_mode == 'IMAGE': - layout.prop(st, "show_safe_areas") - layout.prop(st, "show_metadata") - elif st.display_mode == 'WAVEFORM': - layout.prop(st, "show_separate_color") - layout.separator() layout.operator("render.opengl", text="Sequence Render Image", icon='RENDER_STILL').sequencer = True @@ -276,6 +293,9 @@ class SEQUENCER_MT_view(Menu): props.sequencer = True layout.separator() + layout.operator("sequencer.export_subtitles", text="Export Subtitles", icon="EXPORT") + + layout.separator() layout.menu("INFO_MT_area") @@ -670,7 +690,7 @@ class SEQUENCER_MT_strip(Menu): 'CROSS', 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED', 'MULTICAM', 'ADJUSTMENT', - 'GAUSSIAN_BLUR', 'TEXT', + 'GAUSSIAN_BLUR', }: layout.separator() layout.menu("SEQUENCER_MT_strip_effect") @@ -681,6 +701,9 @@ class SEQUENCER_MT_strip(Menu): layout.separator() layout.operator("sequencer.rendersize") layout.operator("sequencer.images_separate") + elif strip_type == 'TEXT': + layout.separator() + layout.menu("SEQUENCER_MT_strip_effect") elif strip_type == 'META': layout.separator() layout.operator("sequencer.meta_make") @@ -752,7 +775,7 @@ class SEQUENCER_MT_context_menu(Menu): 'CROSS', 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED', 'MULTICAM', 'ADJUSTMENT', - 'GAUSSIAN_BLUR', 'TEXT', + 'GAUSSIAN_BLUR', }: layout.separator() layout.menu("SEQUENCER_MT_strip_effect") @@ -763,6 +786,9 @@ class SEQUENCER_MT_context_menu(Menu): layout.separator() layout.operator("sequencer.rendersize") layout.operator("sequencer.images_separate") + elif strip_type == 'TEXT': + layout.separator() + layout.menu("SEQUENCER_MT_strip_effect") elif strip_type == 'META': layout.separator() layout.operator("sequencer.meta_make") @@ -1038,26 +1064,10 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): col.label(text="Two or more channels are needed below this strip", icon='INFO') elif strip_type == 'TEXT': - col = layout.column() - col.prop(strip, "text") - col.template_ID(strip, "font", open="font.open", unlink="font.unlink") - col.prop(strip, "font_size") - - row = col.row() - row.prop(strip, "color") - row = col.row() - row.prop(strip, "use_shadow") - rowsub = row.row() - rowsub.active = strip.use_shadow - rowsub.prop(strip, "shadow_color", text="") - - col.prop(strip, "align_x", text="Horizontal") - col.prop(strip, "align_y", text="Vertical") - row = col.row(align=True) - row.prop(strip, "location", text="Location", slider=True) - col.prop(strip, "wrap_width") - - layout.operator("sequencer.export_subtitles", text="Export Subtitles", icon='EXPORT') + layout = self.layout + layout.use_property_split = False + layout.prop(strip, "text", text="") + layout.use_property_split = True col = layout.column(align=True) if strip_type == 'SPEED': @@ -1076,6 +1086,73 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): row.prop(strip, "factor", slider=True) +class SEQUENCER_PT_effect_text_layout(SequencerButtonsPanel, Panel): + bl_label = "Layout" + bl_parent_id = "SEQUENCER_PT_effect" + bl_category = "Strip" + + @classmethod + def poll(cls, context): + strip = act_strip(context) + return strip.type == 'TEXT' + + def draw(self, context): + strip = act_strip(context) + layout = self.layout + layout.use_property_split = True + col = layout.column() + col.prop(strip, "location", text="Location") + col.prop(strip, "align_x", text="Alignment X") + col.prop(strip, "align_y", text="Y") + col.prop(strip, "wrap_width", text="Wrap Width") + + +class SEQUENCER_PT_effect_text_style(SequencerButtonsPanel, Panel): + bl_label = "Style" + bl_parent_id = "SEQUENCER_PT_effect" + bl_category = "Strip" + + @classmethod + def poll(cls, context): + strip = act_strip(context) + return strip.type == 'TEXT' + + def draw(self, context): + strip = act_strip(context) + layout = self.layout + layout.use_property_split = True + col = layout.column() + col.template_ID(strip, "font", open="font.open", unlink="font.unlink") + col.prop(strip, "font_size") + col.prop(strip, "color") + + +class SEQUENCER_PT_effect_text_style_shadow(SequencerButtonsPanel, Panel): + bl_label = "Shadow" + bl_parent_id = "SEQUENCER_PT_effect_text_style" + bl_options = {'DEFAULT_CLOSED'} + bl_category = "Strip" + + @classmethod + def poll(cls, context): + strip = act_strip(context) + return strip.type != 'SOUND' + + def draw_header(self, context): + strip = act_strip(context) + self.layout.prop(strip, "use_shadow", text="") + + def draw(self, context): + strip = act_strip(context) + layout = self.layout + layout.use_property_split = True + + layout.active = strip.use_shadow and (not strip.mute) + + col = layout.column(align=True) + col.prop(strip, "shadow_color", text="Color") + + class SEQUENCER_PT_source(SequencerButtonsPanel, Panel): bl_label = "Source" bl_options = {'DEFAULT_CLOSED'} @@ -1843,6 +1920,11 @@ class SEQUENCER_PT_frame_overlay(SequencerButtonsPanel_Output, Panel): def draw(self, context): layout = self.layout + + layout.operator_context = 'INVOKE_REGION_PREVIEW' + layout.operator("sequencer.view_ghost_border", text="Set Overlay Region") + layout.operator_context = 'INVOKE_DEFAULT' + layout.use_property_split = True layout.use_property_decorate = False @@ -2024,6 +2106,7 @@ classes = ( SEQUENCER_MT_view, SEQUENCER_MT_view_cache, SEQUENCER_MT_view_toggle, + SEQUENCER_MT_preview_zoom, SEQUENCER_MT_select_playhead, SEQUENCER_MT_select_handle, SEQUENCER_MT_select_channel, @@ -2057,6 +2140,9 @@ classes = ( SEQUENCER_PT_effect, SEQUENCER_PT_scene, SEQUENCER_PT_mask, + SEQUENCER_PT_effect_text_style, + SEQUENCER_PT_effect_text_layout, + SEQUENCER_PT_effect_text_style_shadow, SEQUENCER_PT_time, SEQUENCER_PT_source, |