Fix errors in vse ui commit
[blender.git] / release / scripts / startup / bl_ui / space_sequencer.py
index 823aa2acf8976d9354da3b8bd9b5d3fdd9ccd7cf..f2deb127a088d54e986abd6bc24b3ff9dff19784 100644 (file)
 # <pep8 compliant>
 import bpy
 from bpy.types import Header, Menu, Panel
+from rna_prop_ui import PropertyPanel
+from bl_ui.properties_grease_pencil_common import (
+        GreasePencilDataPanel,
+        GreasePencilPaletteColorPanel,
+        GreasePencilToolsPanel,
+        )
 from bpy.app.translations import pgettext_iface as iface_
 
 
@@ -30,26 +36,35 @@ def act_strip(context):
 
 
 def draw_color_balance(layout, color_balance):
-    col = layout.column()
+    box = layout.box()
+    split = box.split(percentage=0.35)
+    col = split.column(align=True)
     col.label(text="Lift:")
-    col.template_color_picker(color_balance, "lift", value_slider=True, cubic=True)
-    row = col.row()
-    row.prop(color_balance, "lift", text="")
-    row.prop(color_balance, "invert_lift", text="Inverse")
-
-    col = layout.column()
+    col.separator()
+    col.separator()
+    col.prop(color_balance, "")
+    col.prop(color_balance, "invert_lift", text="Invert", icon="ARROW_LEFTRIGHT")
+    split.template_color_picker(color_balance, "lift", value_slider=True,  cubic=True)
+
+    box = layout.box()
+    split = box.split(percentage=0.35)
+    col = split.column(align=True)
     col.label(text="Gamma:")
-    col.template_color_picker(color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True)
-    row = col.row()
-    row.prop(color_balance, "gamma", text="")
-    row.prop(color_balance, "invert_gamma", text="Inverse")
-
-    col = layout.column()
+    col.separator()
+    col.separator()
+    col.prop(color_balance, "")
+    col.prop(color_balance, "invert_gamma", text="Invert", icon="ARROW_LEFTRIGHT")
+    split.template_color_picker(color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True)
+
+    box = layout.box()
+    split = box.split(percentage=0.35)
+    col = split.column(align=True)
     col.label(text="Gain:")
-    col.template_color_picker(color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True)
-    row = col.row()
-    row.prop(color_balance, "gain", text="")
-    row.prop(color_balance, "invert_gain", text="Inverse")
+    col.separator()
+    col.separator()
+    col.prop(color_balance, "gain", text="")
+    col.prop(color_balance, "invert_gain", text="Invert", icon="ARROW_LEFTRIGHT")
+    split.template_color_picker(color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True)
 
 
 class SEQUENCER_HT_header(Header):
@@ -59,12 +74,17 @@ class SEQUENCER_HT_header(Header):
         layout = self.layout
 
         st = context.space_data
+        scene = context.scene
 
         row = layout.row(align=True)
         row.template_header()
 
         SEQUENCER_MT_editor_menus.draw_collapsible(context, layout)
 
+        row = layout.row(align=True)
+        row.prop(scene, "use_preview_range", text="", toggle=True)
+        row.prop(scene, "lock_frame_selection_to_range", text="", toggle=True)
+
         layout.prop(st, "view_type", expand=True, text="")
 
         if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
@@ -77,6 +97,7 @@ class SEQUENCER_HT_header(Header):
 
             layout.separator()
             layout.operator("sequencer.refresh_all")
+            layout.prop(st, "show_backdrop")
         else:
             if st.view_type == 'SEQUENCER_PREVIEW':
                 layout.separator()
@@ -96,6 +117,17 @@ class SEQUENCER_HT_header(Header):
                     row = layout.row()
                     row.prop(st, "overlay_type", text="")
 
+        if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
+            gpd = context.gpencil_data
+            toolsettings = context.tool_settings
+
+            # Proportional editing
+            if gpd and gpd.use_stroke_edit_mode:
+                row = layout.row(align=True)
+                row.prop(toolsettings, "proportional_edit", icon_only=True)
+                if toolsettings.proportional_edit != 'DISABLED':
+                    row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
+
         row = layout.row(align=True)
         row.operator("render.opengl", text="", icon='RENDER_STILL').sequencer = True
         props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION')
@@ -122,6 +154,7 @@ class SEQUENCER_MT_editor_menus(Menu):
             layout.menu("SEQUENCER_MT_select")
             layout.menu("SEQUENCER_MT_marker")
             layout.menu("SEQUENCER_MT_add")
+            layout.menu("SEQUENCER_MT_frame")
             layout.menu("SEQUENCER_MT_strip")
 
 
@@ -143,8 +176,10 @@ class SEQUENCER_MT_view(Menu):
         layout = self.layout
 
         st = context.space_data
+        is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
+        is_sequencer_view = st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}
 
-        if st.view_type in {'PREVIEW'}:
+        if st.view_type == 'PREVIEW':
             # Specifying the REGION_PREVIEW context is needed in preview-only
             # mode, else the lookup for the shortcut will fail in
             # wm_keymap_item_find_props() (see #32595).
@@ -154,36 +189,53 @@ class SEQUENCER_MT_view(Menu):
 
         layout.separator()
 
-        if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
+        if is_sequencer_view:
+            layout.operator_context = 'INVOKE_REGION_WIN'
             layout.operator("sequencer.view_all", text="View all Sequences")
             layout.operator("sequencer.view_selected")
-        if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
+            layout.operator("sequencer.view_frame")
+            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("sequencer.view_zoom_ratio", text="Show preview 1:1").ratio = 1.0
+
+            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.separator()
+
             layout.operator_context = 'INVOKE_DEFAULT'
 
             # # XXX, invokes in the header view
             # layout.operator("sequencer.view_ghost_border", text="Overlay Border")
 
-        if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
+        if is_sequencer_view:
             layout.prop(st, "show_seconds")
             layout.prop(st, "show_frame_indicator")
+            layout.prop(st, "show_strip_offset")
 
-        if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
+            layout.prop_menu_enum(st, "waveform_draw_type")
+
+        if is_preview:
             if st.display_mode == 'IMAGE':
-                layout.prop(st, "show_safe_margin")
+                layout.prop(st, "show_safe_areas")
+                layout.prop(st, "show_metadata")
             elif st.display_mode == 'WAVEFORM':
                 layout.prop(st, "show_separate_color")
 
         layout.separator()
 
-        if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
+        if is_sequencer_view:
             layout.prop(st, "use_marker_sync")
             layout.separator()
 
         layout.operator("screen.area_dupli")
         layout.operator("screen.screen_full_area")
+        layout.operator("screen.screen_full_area", text="Toggle Fullscreen Area").use_hide_panels = True
 
 
 class SEQUENCER_MT_select(Menu):
@@ -194,6 +246,13 @@ class SEQUENCER_MT_select(Menu):
 
         layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
         layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
+        props = layout.operator("sequencer.select", text="All strips to the Left")
+        props.left_right = 'LEFT'
+        props.linked_time = True
+        props = layout.operator("sequencer.select", text="All strips to the Right")
+        props.left_right = 'RIGHT'
+        props.linked_time = True
+
         layout.separator()
         layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
         layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
@@ -201,6 +260,8 @@ class SEQUENCER_MT_select(Menu):
         layout.separator()
         layout.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
         layout.operator("sequencer.select_linked")
+        layout.operator("sequencer.select_less")
+        layout.operator("sequencer.select_more")
         layout.operator("sequencer.select_all").action = 'TOGGLE'
         layout.operator("sequencer.select_all", text="Inverse").action = 'INVERT'
 
@@ -220,12 +281,51 @@ class SEQUENCER_MT_change(Menu):
 
     def draw(self, context):
         layout = self.layout
+        strip = act_strip(context)
 
         layout.operator_context = 'INVOKE_REGION_WIN'
 
         layout.operator_menu_enum("sequencer.change_effect_input", "swap")
         layout.operator_menu_enum("sequencer.change_effect_type", "type")
-        layout.operator("sequencer.change_path", text="Path/Files")
+        prop = layout.operator("sequencer.change_path", text="Path/Files")
+
+        if strip:
+            stype = strip.type
+
+            if stype == 'IMAGE':
+                prop.filter_image = True
+            elif stype == 'MOVIE':
+                prop.filter_movie = True
+            elif stype == 'SOUND':
+                prop.filter_sound = True
+
+
+class SEQUENCER_MT_frame(Menu):
+    bl_label = "Frame"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("anim.previewrange_clear")
+        layout.operator("anim.previewrange_set")
+
+        layout.separator()
+
+        props = layout.operator("sequencer.strip_jump", text="Jump to Previous Strip")
+        props.next = False
+        props.center = False
+        props = layout.operator("sequencer.strip_jump", text="Jump to Next Strip")
+        props.next = True
+        props.center = False
+
+        layout.separator()
+
+        props = layout.operator("sequencer.strip_jump", text="Jump to Previous Strip (Center)")
+        props.next = False
+        props.center = True
+        props = layout.operator("sequencer.strip_jump", text="Jump to Next Strip (Center)")
+        props.next = True
+        props.center = True
 
 
 class SEQUENCER_MT_add(Menu):
@@ -275,10 +375,12 @@ class SEQUENCER_MT_add_effect(Menu):
         layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
         layout.operator("sequencer.effect_strip_add", text="Cross").type = 'CROSS'
         layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS'
+        layout.operator("sequencer.effect_strip_add", text="Gaussian Blur").type = 'GAUSSIAN_BLUR'
         layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY'
         layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP'
         layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE'
         layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW'
+        layout.operator("sequencer.effect_strip_add", text="Text").type = 'TEXT'
         layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM'
         layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
         layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
@@ -296,7 +398,7 @@ class SEQUENCER_MT_strip(Menu):
 
         layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
         layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
-        layout.operator("sequencer.gap_remove")
+        layout.operator("sequencer.gap_remove").all = False
         layout.operator("sequencer.gap_insert")
 
         #  uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
@@ -304,6 +406,7 @@ class SEQUENCER_MT_strip(Menu):
 
         layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
         layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
+        layout.operator("sequencer.slip", text="Slip Strip Contents")
         layout.operator("sequencer.images_separate")
         layout.operator("sequencer.offset_clear")
         layout.operator("sequencer.deinterlace_selected_movies")
@@ -341,17 +444,11 @@ class SEQUENCER_MT_strip(Menu):
                 layout.operator("sequencer.crossfade_sounds")
 
         layout.separator()
-
         layout.operator("sequencer.meta_make")
         layout.operator("sequencer.meta_separate")
 
-        #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
-        #      uiItemS(layout);
-        #      uiItemO(layout, NULL, 0, "sequencer.meta_toggle");
-        #}
-
         layout.separator()
-        layout.operator("sequencer.reload", text="Reload Strips").adjust_length = False
+        layout.operator("sequencer.reload", text="Reload Strips")
         layout.operator("sequencer.reload", text="Reload Strips and Adjust Length").adjust_length = True
         layout.operator("sequencer.reassign_inputs")
         layout.operator("sequencer.swap_inputs")
@@ -360,7 +457,7 @@ class SEQUENCER_MT_strip(Menu):
         layout.operator("sequencer.lock")
         layout.operator("sequencer.unlock")
         layout.operator("sequencer.mute").unselected = False
-        layout.operator("sequencer.unmute")
+        layout.operator("sequencer.unmute").unselected = False
 
         layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
 
@@ -374,7 +471,7 @@ class SEQUENCER_MT_strip(Menu):
         layout.menu("SEQUENCER_MT_change")
 
 
-class SequencerButtonsPanel():
+class SequencerButtonsPanel:
     bl_space_type = 'SEQUENCE_EDITOR'
     bl_region_type = 'UI'
 
@@ -387,13 +484,14 @@ class SequencerButtonsPanel():
         return cls.has_sequencer(context) and (act_strip(context) is not None)
 
 
-class SequencerButtonsPanel_Output():
+class SequencerButtonsPanel_Output:
     bl_space_type = 'SEQUENCE_EDITOR'
     bl_region_type = 'UI'
 
     @staticmethod
     def has_preview(context):
-        return (context.space_data.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'})
+        st = context.space_data
+        return (st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}) or st.show_backdrop
 
     @classmethod
     def poll(cls, context):
@@ -402,6 +500,7 @@ class SequencerButtonsPanel_Output():
 
 class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
     bl_label = "Edit Strip"
+    bl_category = "Strip"
 
     def draw(self, context):
         layout = self.layout
@@ -410,16 +509,16 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
         frame_current = scene.frame_current
         strip = act_strip(context)
 
-        split = layout.split(percentage=0.3)
+        split = layout.split(percentage=0.25)
         split.label(text="Name:")
         split.prop(strip, "name", text="")
 
-        split = layout.split(percentage=0.3)
+        split = layout.split(percentage=0.25)
         split.label(text="Type:")
         split.prop(strip, "type", text="")
 
-        if strip.type not in {'SOUND'}:
-            split = layout.split(percentage=0.3)
+        if strip.type != 'SOUND':
+            split = layout.split(percentage=0.25)
             split.label(text="Blend:")
             split.prop(strip, "blend_type", text="")
 
@@ -428,16 +527,22 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
             sub.active = (not strip.mute)
             sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
             row.prop(strip, "mute", toggle=True, icon_only=True)
-            row.prop(strip, "lock", toggle=True, icon_only=True)
+
         else:
-            row = layout.row(align=True)
-            row.prop(strip, "mute", toggle=True, icon_only=True)
-            row.prop(strip, "lock", toggle=True, icon_only=True)
+            row = layout.row()
+            row.prop(strip, "mute", toggle=True, icon_only=True, icon='MUTE_IPO_OFF')
 
-        col = layout.column()
-        sub = col.column()
+
+        col = layout.column(align=True)
+        row = col.row(align=True)
+
+        row_sub = row.row(align=True)
+        row_sub.enabled = not strip.lock
+        row_sub.prop(strip, "channel")
+        row.prop(strip, "lock", toggle=True, icon_only=True)
+
+        sub = col.column(align=True)
         sub.enabled = not strip.lock
-        sub.prop(strip, "channel")
         sub.prop(strip, "frame_start")
         sub.prop(strip, "frame_final_duration")
 
@@ -462,12 +567,11 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
 
         if elem and elem.orig_width > 0 and elem.orig_height > 0:
             col.label(text=iface_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
-        else:
-            col.label(text="Original Dimension: None")
 
 
 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
     bl_label = "Effect Strip"
+    bl_category = "Strip"
 
     @classmethod
     def poll(cls, context):
@@ -481,16 +585,16 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
         return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
                               'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
                               'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
-                              'MULTICAM'}
+                              'MULTICAM', 'GAUSSIAN_BLUR', 'TEXT'}
 
     def draw(self, context):
         layout = self.layout
 
-        sequencer = context.scene.sequence_editor
         strip = act_strip(context)
 
         if strip.input_count > 0:
             col = layout.column()
+            col.enabled = False
             col.prop(strip, "input_1")
             if strip.input_count > 1:
                 col.prop(strip, "input_2")
@@ -561,29 +665,74 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
             col.prop(strip, "rotation_start", text="Rotation")
 
         elif strip.type == 'MULTICAM':
-            layout.prop(strip, "multicam_source")
-
-            row = layout.row(align=True)
-            sub = row.row(align=True)
-            sub.scale_x = 2.0
+            col = layout.column(align=True)
+            strip_channel = strip.channel
+
+            col.prop(strip, "multicam_source", text="Source Channel")
+
+            # The multicam strip needs at least 2 strips to be useful
+            if strip_channel > 2:
+                BT_ROW = 4
+
+                col.label("Cut To:")
+                row = col.row()
+
+                for i in range(1, strip_channel):
+                    if (i % BT_ROW) == 1:
+                        row = col.row(align=True)
+
+                    # Workaround - .enabled has to have a separate UI block to work
+                    if i == strip.multicam_source:
+                        sub = row.row(align=True)
+                        sub.enabled = False
+                        sub.operator("sequencer.cut_multicam", text="%d" % i).camera = i
+                    else:
+                        sub_1 = row.row(align=True)
+                        sub_1.enabled = True
+                        sub_1.operator("sequencer.cut_multicam", text="%d" % i).camera = i
+
+                if strip.channel > BT_ROW and (strip_channel - 1) % BT_ROW:
+                    for i in range(strip.channel, strip_channel + ((BT_ROW + 1 - strip_channel) % BT_ROW)):
+                        row.label("")
+            else:
+                col.separator()
+                col.label(text="Two or more channels are needed below this strip", icon="INFO")
 
-            sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY')
 
-            row.label("Cut To")
-            for i in range(1, strip.channel):
-                row.operator("sequencer.cut_multicam", text="%d" % i).camera = i
+        elif strip.type == 'TEXT':
+            col = layout.column()
+            col.prop(strip, "text")
+            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")
+            col.prop(strip, "align_y")
+            col.prop(strip, "location")
+            col.prop(strip, "wrap_width")
+            layout.operator("sequencer.export_subtitles")
 
         col = layout.column(align=True)
         if strip.type == 'SPEED':
             col.prop(strip, "multiply_speed")
-        elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE'}:
+        elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}:
             col.prop(strip, "use_default_fade", "Default fade")
             if not strip.use_default_fade:
                 col.prop(strip, "effect_fader", text="Effect fader")
+        elif strip.type == 'GAUSSIAN_BLUR':
+            col.prop(strip, "size_x")
+            col.prop(strip, "size_y")
 
 
 class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
     bl_label = "Strip Input"
+    bl_category = "Strip"
 
     @classmethod
     def poll(cls, context):
@@ -602,6 +751,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        scene = context.scene
 
         strip = act_strip(context)
 
@@ -615,55 +765,77 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
 
             # Current element for the filename
 
-            elem = strip.strip_elem_from_frame(context.scene.frame_current)
+            elem = strip.strip_elem_from_frame(scene.frame_current)
             if elem:
                 split = layout.split(percentage=0.2)
                 split.label(text="File:")
                 split.prop(elem, "filename", text="")  # strip.elements[0] could be a fallback
 
-            layout.prop(strip.colorspace_settings, "name")
-            layout.prop(strip, "alpha_mode")
+            split = layout.split(percentage=0.4)
+            split.label(text="Color Space:")
+            split.prop(strip.colorspace_settings, "name", text="")
 
-            layout.operator("sequencer.change_path")
+            split = layout.split(percentage=0.4)
+            split.label(text="Alpha:")
+            split.prop(strip, "alpha_mode", text="")
+
+            layout.operator("sequencer.change_path", icon="FILESEL").filter_image = True
 
         elif seq_type == 'MOVIE':
             split = layout.split(percentage=0.2)
             split.label(text="Path:")
             split.prop(strip, "filepath", text="")
 
-            layout.prop(strip.colorspace_settings, "name")
+            split = layout.split(percentage=0.4)
+            split.label(text="Color Space:")
+            split.prop(strip.colorspace_settings, "name", text="")
 
             layout.prop(strip, "mpeg_preseek")
             layout.prop(strip, "stream_index")
 
         layout.prop(strip, "use_translation", text="Image Offset")
         if strip.use_translation:
-            col = layout.column(align=True)
-            col.prop(strip.transform, "offset_x", text="X")
-            col.prop(strip.transform, "offset_y", text="Y")
+            row = layout.row(align=True)
+            row.prop(strip.transform, "offset_x", text="X")
+            row.prop(strip.transform, "offset_y", text="Y")
 
         layout.prop(strip, "use_crop", text="Image Crop")
         if strip.use_crop:
             col = layout.column(align=True)
             col.prop(strip.crop, "max_y")
-            col.prop(strip.crop, "min_x")
+            row = col.row(align=True)
+            row.prop(strip.crop, "min_x")
+            row.prop(strip.crop, "max_x")
             col.prop(strip.crop, "min_y")
-            col.prop(strip.crop, "max_x")
 
         if not isinstance(strip, bpy.types.EffectSequence):
-            col = layout.column(align=True)
-            col.label(text="Trim Duration (hard):")
-            col.prop(strip, "animation_offset_start", text="Start")
-            col.prop(strip, "animation_offset_end", text="End")
+            layout.label(text="Trim Duration (hard):")
+            row = layout.row(align=True)
+            row.prop(strip, "animation_offset_start", text="Start")
+            row.prop(strip, "animation_offset_end", text="End")
 
-        col = layout.column(align=True)
-        col.label(text="Trim Duration (soft):")
-        col.prop(strip, "frame_offset_start", text="Start")
-        col.prop(strip, "frame_offset_end", text="End")
+        layout.label(text="Trim Duration (soft):")
+        row = layout.row(align=True)
+        row.prop(strip, "frame_offset_start", text="Start")
+        row.prop(strip, "frame_offset_end", text="End")
+
+        if scene.render.use_multiview and seq_type in {'IMAGE', 'MOVIE'}:
+            layout.prop(strip, "use_multiview")
+
+            col = layout.column()
+            col.active = strip.use_multiview
+
+            col.label(text="Views Format:")
+            col.row().prop(strip, "views_format", expand=True)
+
+            box = col.box()
+            box.active = strip.views_format == 'STEREO_3D'
+            box.template_image_stereo_3d(strip.stereo_3d_format)
 
 
 class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
     bl_label = "Sound"
+    bl_category = "Strip"
 
     @classmethod
     def poll(cls, context):
@@ -679,15 +851,14 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
 
+        st = context.space_data
         strip = act_strip(context)
         sound = strip.sound
 
         layout.template_ID(strip, "sound", open="sound.open")
-
-        layout.separator()
-        layout.prop(strip, "filepath", text="")
-
         if sound is not None:
+            layout.prop(sound, "filepath", text="")
+
             row = layout.row()
             if sound.packed_file:
                 row.operator("sound.unpack", icon='PACKAGE', text="Unpack")
@@ -696,24 +867,32 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
 
             row.prop(sound, "use_memory_cache")
 
-        layout.prop(strip, "show_waveform")
-        layout.prop(strip, "volume")
-        layout.prop(strip, "pitch")
-        layout.prop(strip, "pan")
+            layout.prop(sound, "use_mono")
+
+        if st.waveform_draw_type == 'DEFAULT_WAVEFORMS':
+            layout.prop(strip, "show_waveform")
+
+        col = layout.column(align=True)
+        col.prop(strip, "volume")
+        col.prop(strip, "pitch")
+        col.prop(strip, "pan")
 
         col = layout.column(align=True)
         col.label(text="Trim Duration (hard):")
-        col.prop(strip, "animation_offset_start", text="Start")
-        col.prop(strip, "animation_offset_end", text="End")
+        row = layout.row(align=True)
+        row.prop(strip, "animation_offset_start", text="Start")
+        row.prop(strip, "animation_offset_end", text="End")
 
         col = layout.column(align=True)
         col.label(text="Trim Duration (soft):")
-        col.prop(strip, "frame_offset_start", text="Start")
-        col.prop(strip, "frame_offset_end", text="End")
+        row = layout.row(align=True)
+        row.prop(strip, "frame_offset_start", text="Start")
+        row.prop(strip, "frame_offset_end", text="End")
 
 
 class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
     bl_label = "Scene"
+    bl_category = "Strip"
 
     @classmethod
     def poll(cls, context):
@@ -734,13 +913,25 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
         layout.template_ID(strip, "scene")
 
         scene = strip.scene
+        layout.prop(strip, "use_sequence")
+
+        if not strip.use_sequence:
+            layout.label(text="Camera Override")
+            layout.template_ID(strip, "scene_camera")
 
-        layout.label(text="Camera Override")
-        layout.template_ID(strip, "scene_camera")
+            layout.prop(strip, "use_grease_pencil", text="Show Grease Pencil")
 
         if scene:
             layout.prop(scene, "audio_volume", text="Audio Volume")
 
+        if not strip.use_sequence:
+            if scene:
+                # Warning, this is not a good convention to follow.
+                # Expose here because setting the alpha from the 'Render' menu is very inconvenient.
+                layout.label("Preview")
+                layout.prop(scene.render, "alpha_mode")
+
+        if scene:
             sta = scene.frame_start
             end = scene.frame_end
             layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
@@ -748,6 +939,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
 
 class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
     bl_label = "Mask"
+    bl_category = "Strip"
 
     @classmethod
     def poll(cls, context):
@@ -777,6 +969,7 @@ class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
 
 class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
     bl_label = "Filter"
+    bl_category = "Strip"
 
     @classmethod
     def poll(cls, context):
@@ -811,26 +1004,25 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
             col.label(text="Distortion:")
             col.prop(strip, "undistort")
 
-        split = layout.split(percentage=0.65)
-
+        split = layout.split(percentage=0.6)
         col = split.column()
-        col.prop(strip, "use_reverse_frames", text="Backwards")
+        col.prop(strip, "use_reverse_frames", text="Reverse")
         col.prop(strip, "use_deinterlace")
 
         col = split.column()
-        col.label(text="Flip:")
-        col.prop(strip, "use_flip_x", text="X")
-        col.prop(strip, "use_flip_y", text="Y")
+        col.prop(strip, "use_flip_x", text="X Flip")
+        col.prop(strip, "use_flip_y", text="Y Flip")
 
-        col = layout.column()
-        col.label(text="Colors:")
+        layout.label("Color:")
+        col = layout.column(align=True)
         col.prop(strip, "color_saturation", text="Saturation")
         col.prop(strip, "color_multiply", text="Multiply")
-        col.prop(strip, "use_float")
+        layout.prop(strip, "use_float", text="Convert to Float")
 
 
 class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
-    bl_label = "Proxy / Timecode"
+    bl_label = "Proxy/Timecode"
+    bl_category = "Strip"
 
     @classmethod
     def poll(cls, context):
@@ -851,32 +1043,46 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
 
+        sequencer = context.scene.sequence_editor
+
         strip = act_strip(context)
 
-        flow = layout.column_flow()
-        flow.prop(strip, "use_proxy_custom_directory")
-        flow.prop(strip, "use_proxy_custom_file")
         if strip.proxy:
-            if strip.use_proxy_custom_directory and not strip.use_proxy_custom_file:
-                flow.prop(strip.proxy, "directory")
-            if strip.use_proxy_custom_file:
-                flow.prop(strip.proxy, "filepath")
+            proxy = strip.proxy
 
-            row = layout.row()
-            row.prop(strip.proxy, "build_25")
-            row.prop(strip.proxy, "build_50")
-            row.prop(strip.proxy, "build_75")
-            row.prop(strip.proxy, "build_100")
+            flow = layout.column_flow()
+            flow.prop(sequencer, "proxy_storage", text='Storage')
+            if sequencer.proxy_storage == 'PROJECT':
+                flow.prop(sequencer, "proxy_dir", text='Directory')
+            else:
+                flow.prop(proxy, "use_proxy_custom_directory")
+                flow.prop(proxy, "use_proxy_custom_file")
+
+                if proxy.use_proxy_custom_directory and not proxy.use_proxy_custom_file:
+                    flow.prop(proxy, "directory")
+                if proxy.use_proxy_custom_file:
+                    flow.prop(proxy, "filepath")
+
+            row = layout.row(align=True)
+            row.prop(strip.proxy, "build_25", toggle=True)
+            row.prop(strip.proxy, "build_50", toggle=True)
+            row.prop(strip.proxy, "build_75", toggle=True)
+            row.prop(strip.proxy, "build_100", toggle=True)
+
+            layout.prop(proxy, "use_overwrite")
 
             col = layout.column()
-            col.label(text="Build JPEG quality")
-            col.prop(strip.proxy, "quality")
+            col.prop(proxy, "quality", text="Build JPEG quality")
 
             if strip.type == 'MOVIE':
                 col = layout.column()
                 col.label(text="Use timecode index:")
 
-                col.prop(strip.proxy, "timecode")
+                col.prop(proxy, "timecode")
+
+        col = layout.column()
+        col.operator("sequencer.enable_proxies")
+        col.operator("sequencer.rebuild_proxy")
 
 
 class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
@@ -890,7 +1096,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
         render = context.scene.render
 
         col = layout.column()
-        col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
+        col.prop(render, "use_sequencer_gl_preview", text="OpenGL Preview")
         col = layout.column()
         #col.active = render.use_sequencer_gl_preview
         col.prop(render, "sequencer_gl_preview", text="")
@@ -911,14 +1117,44 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
         col = layout.column()
         if st.display_mode == 'IMAGE':
             col.prop(st, "draw_overexposed")
-            col.prop(st, "show_safe_margin")
+            col.separator()
+
         elif st.display_mode == 'WAVEFORM':
             col.prop(st, "show_separate_color")
+
+        col = layout.column()
+        col.separator()
         col.prop(st, "proxy_render_size")
 
 
+class SEQUENCER_PT_view_safe_areas(SequencerButtonsPanel_Output, Panel):
+    bl_label = "Safe Areas"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        st = context.space_data
+        is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
+        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="")
+
+    def draw(self, context):
+        from bl_ui.properties_data_camera import draw_display_safe_settings
+
+        layout = self.layout
+        st = context.space_data
+        safe_data = context.scene.safe_areas
+
+        draw_display_safe_settings(layout, safe_data, st)
+
+
 class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
     bl_label = "Modifiers"
+    bl_category = "Modifiers"
 
     def draw(self, context):
         layout = self.layout
@@ -929,6 +1165,7 @@ class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
         layout.prop(strip, "use_linear_modifiers")
 
         layout.operator_menu_enum("sequencer.strip_modifier_add", "type")
+        layout.operator("sequencer.strip_modifier_copy")
 
         for mod in strip.modifiers:
             box = layout.box()
@@ -960,6 +1197,8 @@ class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
                     box.prop_search(mod, "input_mask_strip", sequences_object, "sequences", text="Mask")
                 else:
                     box.prop(mod, "input_mask_id")
+                    row = box.row()
+                    row.prop(mod, "mask_time", expand=True)
 
                 if mod.type == 'COLOR_BALANCE':
                     box.prop(mod, "color_multiply")
@@ -972,7 +1211,86 @@ class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
                     col = box.column()
                     col.prop(mod, "bright")
                     col.prop(mod, "contrast")
+                elif mod.type == 'WHITE_BALANCE':
+                    col = box.column()
+                    col.prop(mod, "white_value")
+                elif mod.type == 'TONEMAP':
+                    col = box.column()
+                    col.prop(mod, "tonemap_type")
+                    if mod.tonemap_type == 'RD_PHOTORECEPTOR':
+                        col.prop(mod, "intensity")
+                        col.prop(mod, "contrast")
+                        col.prop(mod, "adaptation")
+                        col.prop(mod, "correction")
+                    elif mod.tonemap_type == 'RH_SIMPLE':
+                        col.prop(mod, "key")
+                        col.prop(mod, "offset")
+                        col.prop(mod, "gamma")
+
+
+class SEQUENCER_PT_grease_pencil(GreasePencilDataPanel, SequencerButtonsPanel_Output, Panel):
+    bl_space_type = 'SEQUENCE_EDITOR'
+    bl_region_type = 'UI'
+
+    # NOTE: this is just a wrapper around the generic GP Panel
+    # But, it should only show up when there are images in the preview region
+
+
+class SEQUENCER_PT_grease_pencil_palettecolor(GreasePencilPaletteColorPanel, SequencerButtonsPanel_Output, Panel):
+    bl_space_type = 'SEQUENCE_EDITOR'
+    bl_region_type = 'UI'
+
+    # NOTE: this is just a wrapper around the generic GP Panel
+    # But, it should only show up when there are images in the preview region
+
+
+class SEQUENCER_PT_grease_pencil_tools(GreasePencilToolsPanel, SequencerButtonsPanel_Output, Panel):
+    bl_space_type = 'SEQUENCE_EDITOR'
+    bl_region_type = 'UI'
 
+    # NOTE: this is just a wrapper around the generic GP tools panel
+    # It contains access to some essential tools usually found only in
+    # toolbar, which doesn't exist here...
+
+
+class SEQUENCER_PT_custom_props(SequencerButtonsPanel, PropertyPanel, Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "scene.sequence_editor.active_strip"
+    _property_type = (bpy.types.Sequence,)
+    bl_category = "Strip"
+
+
+classes = (
+    SEQUENCER_HT_header,
+    SEQUENCER_MT_editor_menus,
+    SEQUENCER_MT_view,
+    SEQUENCER_MT_view_toggle,
+    SEQUENCER_MT_select,
+    SEQUENCER_MT_marker,
+    SEQUENCER_MT_change,
+    SEQUENCER_MT_frame,
+    SEQUENCER_MT_add,
+    SEQUENCER_MT_add_effect,
+    SEQUENCER_MT_strip,
+    SEQUENCER_PT_edit,
+    SEQUENCER_PT_effect,
+    SEQUENCER_PT_input,
+    SEQUENCER_PT_sound,
+    SEQUENCER_PT_scene,
+    SEQUENCER_PT_mask,
+    SEQUENCER_PT_filter,
+    SEQUENCER_PT_proxy,
+    SEQUENCER_PT_preview,
+    SEQUENCER_PT_view,
+    SEQUENCER_PT_view_safe_areas,
+    SEQUENCER_PT_modifiers,
+    SEQUENCER_PT_grease_pencil,
+    SEQUENCER_PT_grease_pencil_palettecolor,
+    SEQUENCER_PT_grease_pencil_tools,
+    SEQUENCER_PT_custom_props,
+)
 
 if __name__ == "__main__":  # only for live edit.
-    bpy.utils.register_module(__name__)
+    from bpy.utils import register_class
+    for cls in classes:
+        register_class(cls)