diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-22 03:50:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-22 03:53:52 +0300 |
commit | 31d6dc6abf70ce925518e82cbfa1ed23e517afed (patch) | |
tree | b5b60ceb66a9a6a85799fbede518d1a860ce1ac5 /release/scripts/startup/bl_ui/space_sequencer.py | |
parent | 90cb821e23b7f795e43516a596b574982648403f (diff) |
Cleanup: sequencer source panel
Split sound from image/movie branch (since image/movie share logic).
Diffstat (limited to 'release/scripts/startup/bl_ui/space_sequencer.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 83 |
1 files changed, 37 insertions, 46 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index d777382d51d..5324f2174bd 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -1070,33 +1070,8 @@ class SEQUENCER_PT_source(SequencerButtonsPanel, Panel): layout.active = not strip.mute - # draw a filename if we have one - if seq_type == 'IMAGE': - col = layout.column() - col.prop(strip, "directory", text="") - - # Current element for the filename - - elem = strip.strip_elem_from_frame(scene.frame_current) - if elem: - col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback - - col.prop(strip.colorspace_settings, "name", text="Color Space") - - col.prop(strip, "alpha_mode", text="Alpha") - sub = col.column(align=True) - sub.operator("sequencer.change_path", text="Change Data/Files", icon='FILEBROWSER').filter_image = True - - elif seq_type == 'MOVIE': - - col = layout.column() - col.prop(strip, "filepath", text="") - col.prop(strip.colorspace_settings, "name", text="Color Space") - col.prop(strip, "mpeg_preseek") - col.prop(strip, "stream_index") - col.prop(strip, "use_deinterlace") - - elif seq_type == 'SOUND': + # Draw a filename if we have one. + if seq_type == 'SOUND': sound = strip.sound layout.template_ID(strip, "sound", open="sound.open") if sound is not None: @@ -1116,37 +1091,53 @@ class SEQUENCER_PT_source(SequencerButtonsPanel, Panel): split.operator("sound.pack", icon='UGLYPACKAGE', text="") layout.prop(sound, "use_memory_cache") + else: + if seq_type == 'IMAGE': + col = layout.column() + col.prop(strip, "directory", text="") - if scene.render.use_multiview and seq_type in {'IMAGE', 'MOVIE'}: - layout.prop(strip, "use_multiview") + # Current element for the filename. + elem = strip.strip_elem_from_frame(scene.frame_current) + if elem: + col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback - col = layout.column() - col.active = strip.use_multiview + col.prop(strip.colorspace_settings, "name", text="Color Space") - col.row().prop(strip, "views_format", expand=True) + col.prop(strip, "alpha_mode", text="Alpha") + sub = col.column(align=True) + sub.operator("sequencer.change_path", text="Change Data/Files", icon='FILEBROWSER').filter_image = True + else: # elif seq_type == 'MOVIE': + elem = strip.elements[0] - box = col.box() - box.active = strip.views_format == 'STEREO_3D' - box.template_image_stereo_3d(strip.stereo_3d_format) + col = layout.column() + col.prop(strip, "filepath", text="") + col.prop(strip.colorspace_settings, "name", text="Color Space") + col.prop(strip, "mpeg_preseek") + col.prop(strip, "stream_index") + col.prop(strip, "use_deinterlace") - if strip.type == 'IMAGE': - # Alreay set above. - # elem = strip.strip_elem_from_frame(scene.frame_current) - pass - elif strip.type == 'MOVIE': - elem = strip.elements[0] - else: - elem = None + if scene.render.use_multiview: + layout.prop(strip, "use_multiview") + + col = layout.column() + col.active = strip.use_multiview + + 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) - if strip.type != 'SOUND': + # Resolution. col = layout.column(align=True) col = col.box() split = col.split(factor=0.5, align=False) split.alignment = 'RIGHT' split.label(text="Resolution") - if elem and elem.orig_width > 0 and elem.orig_height > 0: + size = (elem.orig_width, elem.orig_height) if elem else (0, 0) + if size[0] and size[1]: split.alignment = 'LEFT' - split.label(text="%dx%d" % (elem.orig_width, elem.orig_height), translate=False) + split.label(text="%dx%d" % size, translate=False) else: split.label(text="None") |