[Bf-blender-cvs] [86eefefdc1a] master: UI: Video Sequencer sidebar overhaul

William Reynish noreply at git.blender.org
Thu May 16 13:58:06 CEST 2019


Commit: 86eefefdc1aae2a3ab4160770032671abf55aa30
Author: William Reynish
Date:   Thu May 16 13:58:04 2019 +0200
Branches: master
https://developer.blender.org/rB86eefefdc1aae2a3ab4160770032671abf55aa30

UI: Video Sequencer sidebar overhaul

  - Use single column layout
  - Move the rather obscure Backdrop toggle into the View menu
  - Use correct units for Crop and Offset (pixels)
  - Re-organize the sidebar in 2 main groups: Adjust & Info

Adjust includes Compositing, Offset, Crop, Video, Color, Sound
Info includes strip name, path, start/end and other data

Original changes by tintwotin, with changes and adjustments on top by me

===================================================================

M	release/scripts/startup/bl_ui/space_sequencer.py
M	source/blender/makesrna/intern/rna_sequencer.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index d820676c86c..73a252885a8 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -44,7 +44,14 @@ def selected_sequences_len(context):
 
 
 def draw_color_balance(layout, color_balance):
-    box = layout.box()
+
+    layout.use_property_split = False
+
+    flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+    col = flow.column()
+    
+
+    box = col.box()
     split = box.split(factor=0.35)
     col = split.column(align=True)
     col.label(text="Lift:")
@@ -54,7 +61,9 @@ def draw_color_balance(layout, 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()
+    col = flow.column()
+
+    box = col.box()
     split = box.split(factor=0.35)
     col = split.column(align=True)
     col.label(text="Gamma:")
@@ -64,7 +73,9 @@ def draw_color_balance(layout, 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()
+    col = flow.column()
+
+    box = col.box()
     split = box.split(factor=0.35)
     col = split.column(align=True)
     col.label(text="Gain:")
@@ -90,9 +101,6 @@ class SEQUENCER_HT_header(Header):
 
         SEQUENCER_MT_editor_menus.draw_collapsible(context, layout)
 
-        if st.view_type == 'SEQUENCER':
-            layout.prop(st, "show_backdrop", text="Backdrop")
-
         layout.separator_spacer()
 
         layout.template_running_jobs()
@@ -196,6 +204,9 @@ class SEQUENCER_MT_view(Menu):
             layout.operator_context = 'INVOKE_REGION_PREVIEW'
         layout.prop(st, "show_region_ui")
         layout.operator_context = 'INVOKE_DEFAULT'
+        
+        if st.view_type == 'SEQUENCER':
+            layout.prop(st, "show_backdrop", text="Backdrop")
 
         layout.separator()
 
@@ -689,76 +700,81 @@ class SequencerButtonsPanel_Output:
         return cls.has_preview(context)
 
 
-class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
-    bl_label = "Edit Strip"
+class SEQUENCER_PT_info(SequencerButtonsPanel, Panel):
+    bl_label = "Info"
+    bl_options = {'DEFAULT_CLOSED'}
     bl_category = "Strip"
 
     def draw(self, context):
         layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False
 
         scene = context.scene
-        frame_current = scene.frame_current
         strip = act_strip(context)
 
-        split = layout.split(factor=0.25)
-        split.label(text="Name:")
-        split.prop(strip, "name", text="")
+        row = layout.row(align=True)
+        row.prop(strip, "name", text=""+strip.type.title()+"")
+        row.prop(strip, "lock", toggle=True, icon_only=True)
 
-        split = layout.split(factor=0.25)
-        split.label(text="Type:")
-        split.prop(strip, "type", text="")
 
-        if strip.type != 'SOUND':
-            split = layout.split(factor=0.25)
-            split.label(text="Blend:")
-            split.prop(strip, "blend_type", text="")
+class SEQUENCER_PT_adjust_offset(SequencerButtonsPanel, Panel):
+    bl_label = "Offset"
+    bl_parent_id = "SEQUENCER_PT_adjust"
+    bl_options = {'DEFAULT_CLOSED'}
 
-            row = layout.row(align=True)
-            sub = row.row(align=True)
-            sub.active = (not strip.mute)
-            sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
-            row.prop(strip, "mute", toggle=True, icon_only=True)
+    @classmethod
+    def poll(cls, context):
+        strip = act_strip(context)
+        return strip.type != 'SOUND'
 
-        else:
-            row = layout.row()
-            row.prop(strip, "mute", toggle=True, icon_only=True, icon='MUTE_IPO_OFF')
+    def draw_header(self, context):
+        strip = act_strip(context)
+        self.layout.prop(strip, "use_translation", text="")
 
-        col = layout.column(align=True)
-        row = col.row(align=True)
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False
 
-        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)
+        strip = act_strip(context)
 
-        sub = col.column(align=True)
-        sub.enabled = not strip.lock
-        sub.prop(strip, "frame_start")
-        sub.prop(strip, "frame_final_duration")
+        layout.active = strip.use_translation
 
         col = layout.column(align=True)
-        row = col.row(align=True)
-        row.label(text=iface_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
-                  translate=False)
-        row = col.row(align=True)
-        row.active = strip.frame_start <= frame_current <= strip.frame_start + strip.frame_duration
-        row.label(text=iface_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
 
-        col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
-                  translate=False)
-        col.label(text=iface_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
+        col.prop(strip.transform, "offset_x", text="Position X")
+        col.prop(strip.transform, "offset_y", text="Y")
 
-        elem = False
 
-        if strip.type == 'IMAGE':
-            elem = strip.strip_elem_from_frame(frame_current)
-        elif strip.type == 'MOVIE':
-            elem = strip.elements[0]
+class SEQUENCER_PT_adjust_crop(SequencerButtonsPanel, Panel):
+    bl_label = "Crop"
+    bl_parent_id = "SEQUENCER_PT_adjust"
+    bl_options = {'DEFAULT_CLOSED'}
 
-        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")
+    @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_crop", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False
+
+        strip = act_strip(context)
+
+        layout.active = strip.use_crop
+
+        col = layout.column(align=True)
+        col.prop(strip.crop, "min_x")
+        col.prop(strip.crop, "max_x")
+        col.prop(strip.crop, "max_y")
+        col.prop(strip.crop, "min_y")
 
 
 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
@@ -783,6 +799,8 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False
 
         strip = act_strip(context)
 
@@ -799,7 +817,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
         elif strip.type == 'WIPE':
             col = layout.column()
             col.prop(strip, "transition_type")
-            col.label(text="Direction:")
+            col.alignment = "RIGHT"
             col.row().prop(strip, "direction", expand=True)
 
             col = layout.column()
@@ -826,7 +844,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
                     layout.prop(strip, "speed_factor")
                 else:
                     layout.prop(strip, "speed_factor", text="Frame Number")
-                    layout.prop(strip, "use_scale_to_length")
+                    layout.prop(strip, "scale_to_length")
 
         elif strip.type == 'TRANSFORM':
             layout = self.layout
@@ -834,11 +852,9 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
 
             col.prop(strip, "interpolation")
             col.prop(strip, "translation_unit")
-            col = layout.column(align=True)
-            col.label(text="Position:")
-            row = col.row(align=True)
-            row.prop(strip, "translate_start_x", text="X")
-            row.prop(strip, "translate_start_y", text="Y")
+            layout=layout.column(align=True)
+            layout.prop(strip, "translate_start_x", text="Position X")
+            layout.prop(strip, "translate_start_y", text="Y")
 
             layout.separator()
 
@@ -848,17 +864,12 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
                 col = layout.column(align=True)
                 col.prop(strip, "scale_start_x", text="Scale")
             else:
-                col = layout.column(align=True)
-                col.label(text="Scale:")
-                row = col.row(align=True)
-                row.prop(strip, "scale_start_x", text="X")
-                row.prop(strip, "scale_start_y", text="Y")
+                layout.prop(strip, "scale_start_x", text="Scale X")
+                layout.prop(strip, "scale_start_y", text="Y")
 
             layout.separator()
 
-            col = layout.column(align=True)
-            col.label(text="Rotation:")
-            col.prop(strip, "rotation_start", text="Rotation")
+            layout.prop(strip, "rotation_start", text="Rotation")
 
         elif strip.type == 'MULTICAM':
             col = layout.column(align=True)
@@ -869,8 +880,8 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
             # The multicam strip needs at least 2 strips to be useful
             if strip_channel > 2:
                 BT_ROW = 4
-
-                col.label(text="Cut To:")
+                #col.alignment = "RIGHT"
+                col.label(text="    Cut to")
                 row = col.row()
 
                 for i in range(1, strip_channel):
@@ -909,12 +920,12 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list