diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_sequencer.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 132 |
1 files changed, 88 insertions, 44 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 858c619d3c1..36f606da635 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -18,6 +18,7 @@ # <pep8 compliant> import bpy +from bpy.types import Header, Menu, Panel def act_strip(context): @@ -27,7 +28,7 @@ def act_strip(context): return None -class SEQUENCER_HT_header(bpy.types.Header): +class SEQUENCER_HT_header(Header): bl_space_type = 'SEQUENCE_EDITOR' def draw(self, context): @@ -39,28 +40,28 @@ class SEQUENCER_HT_header(bpy.types.Header): row.template_header() if context.area.show_menus: - sub = row.row(align=True) - sub.menu("SEQUENCER_MT_view") + row.menu("SEQUENCER_MT_view") - if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'): - sub.menu("SEQUENCER_MT_select") - sub.menu("SEQUENCER_MT_marker") - sub.menu("SEQUENCER_MT_add") - sub.menu("SEQUENCER_MT_strip") + if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}: + row.menu("SEQUENCER_MT_select") + row.menu("SEQUENCER_MT_marker") + row.menu("SEQUENCER_MT_add") + row.menu("SEQUENCER_MT_strip") layout.prop(st, "view_type", expand=True, text="") - if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'): + if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}: layout.prop(st, "display_mode", expand=True, text="") - if (st.view_type == 'SEQUENCER'): + if st.view_type == 'SEQUENCER': row = layout.row(align=True) row.operator("sequencer.copy", text="", icon='COPYDOWN') row.operator("sequencer.paste", text="", icon='PASTEDOWN') layout.separator() layout.operator("sequencer.refresh_all") - elif (st.view_type == 'SEQUENCER_PREVIEW'): + layout.template_running_jobs() + elif st.view_type == 'SEQUENCER_PREVIEW': layout.separator() layout.operator("sequencer.refresh_all") layout.prop(st, "display_channel", text="Channel") @@ -76,7 +77,7 @@ class SEQUENCER_HT_header(bpy.types.Header): row.prop(ed, "overlay_lock", text="", icon='LOCKED') -class SEQUENCER_MT_view_toggle(bpy.types.Menu): +class SEQUENCER_MT_view_toggle(Menu): bl_label = "View Type" def draw(self, context): @@ -87,7 +88,7 @@ class SEQUENCER_MT_view_toggle(bpy.types.Menu): layout.operator("sequencer.view_toggle").type = 'SEQUENCER_PREVIEW' -class SEQUENCER_MT_view(bpy.types.Menu): +class SEQUENCER_MT_view(Menu): bl_label = "View" def draw(self, context): @@ -95,15 +96,13 @@ class SEQUENCER_MT_view(bpy.types.Menu): st = context.space_data - layout.column() - layout.operator("sequencer.properties", icon='MENU_PANEL') layout.separator() - if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'): + if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}: layout.operator("sequencer.view_all", text='View all Sequences') - if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'): + if st.view_type in {'PREVIEW', 'SEQUENCER_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 @@ -114,7 +113,11 @@ class SEQUENCER_MT_view(bpy.types.Menu): layout.operator("sequencer.view_selected") - layout.prop(st, "show_frames") + if st.show_frames: + layout.operator("anim.time_toggle", text="Show Seconds") + else: + layout.operator("anim.time_toggle", text="Show Frames") + layout.prop(st, "show_frame_indicator") if st.display_mode == 'IMAGE': layout.prop(st, "show_safe_margin") @@ -129,13 +132,12 @@ class SEQUENCER_MT_view(bpy.types.Menu): layout.operator("screen.screen_full_area") -class SEQUENCER_MT_select(bpy.types.Menu): +class SEQUENCER_MT_select(Menu): bl_label = "Select" def draw(self, context): layout = self.layout - layout.column() 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' layout.separator() @@ -148,7 +150,7 @@ class SEQUENCER_MT_select(bpy.types.Menu): layout.operator("sequencer.select_inverse") -class SEQUENCER_MT_marker(bpy.types.Menu): +class SEQUENCER_MT_marker(Menu): bl_label = "Marker" def draw(self, context): @@ -156,7 +158,6 @@ class SEQUENCER_MT_marker(bpy.types.Menu): #layout.operator_context = 'EXEC_REGION_WIN' - layout.column() layout.operator("marker.add", "Add Marker") layout.operator("marker.duplicate", text="Duplicate Marker") layout.operator("marker.delete", text="Delete Marker") @@ -169,14 +170,26 @@ class SEQUENCER_MT_marker(bpy.types.Menu): #layout.operator("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS) -class SEQUENCER_MT_add(bpy.types.Menu): +class SEQUENCER_MT_change(Menu): + bl_label = "Change" + + def draw(self, context): + layout = self.layout + + 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") + + +class SEQUENCER_MT_add(Menu): bl_label = "Add" def draw(self, context): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - layout.column() if len(bpy.data.scenes) > 10: layout.operator_context = 'INVOKE_DEFAULT' layout.operator("sequencer.scene_strip_add", text="Scene...") @@ -190,14 +203,13 @@ class SEQUENCER_MT_add(bpy.types.Menu): layout.menu("SEQUENCER_MT_add_effect") -class SEQUENCER_MT_add_effect(bpy.types.Menu): +class SEQUENCER_MT_add_effect(Menu): bl_label = "Effect Strip..." def draw(self, context): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - layout.column() layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD' layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT' layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER' @@ -216,7 +228,7 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu): layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT' -class SEQUENCER_MT_strip(bpy.types.Menu): +class SEQUENCER_MT_strip(Menu): bl_label = "Strip" def draw(self, context): @@ -224,7 +236,6 @@ class SEQUENCER_MT_strip(bpy.types.Menu): layout.operator_context = 'INVOKE_REGION_WIN' - layout.column() layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION' layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND' # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator @@ -233,7 +244,9 @@ class SEQUENCER_MT_strip(bpy.types.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.images_separate") + layout.operator("sequencer.offset_clear") layout.operator("sequencer.deinterlace_selected_movies") + layout.operator("sequencer.rebuild_proxy") layout.separator() layout.operator("sequencer.duplicate") @@ -292,6 +305,7 @@ class SEQUENCER_MT_strip(bpy.types.Menu): layout.separator() layout.operator("sequencer.swap_data") + layout.menu("SEQUENCER_MT_change") class SequencerButtonsPanel(): @@ -300,7 +314,7 @@ class SequencerButtonsPanel(): @staticmethod def has_sequencer(context): - return (context.space_data.view_type == 'SEQUENCER') or (context.space_data.view_type == 'SEQUENCER_PREVIEW') + return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}) @classmethod def poll(cls, context): @@ -313,14 +327,14 @@ class SequencerButtonsPanel_Output(): @staticmethod def has_preview(context): - return (context.space_data.view_type == 'PREVIEW') or (context.space_data.view_type == 'SEQUENCER_PREVIEW') + return (context.space_data.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}) @classmethod def poll(cls, context): return cls.has_preview(context) -class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel): +class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel): bl_label = "Edit Strip" def draw(self, context): @@ -374,9 +388,11 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel): if elem and elem.orig_width > 0 and elem.orig_height > 0: col.label(text="Orig Dim: %dx%d" % (elem.orig_width, elem.orig_height)) + else: + col.label(text="Orig Dim: None") -class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel): +class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): bl_label = "Effect Strip" @classmethod @@ -514,7 +530,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel): col.prop(strip, "rotation_start", text="Rotation") -class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel): +class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): bl_label = "Strip Input" @classmethod @@ -558,6 +574,9 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel): col = split.column() col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback + # also accessible from the menu + layout.operator("sequencer.change_path") + elif seq_type == 'MOVIE': split = layout.split(percentage=0.2) col = split.column() @@ -565,6 +584,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel): col = split.column() col.prop(strip, "filepath", text="") col.prop(strip, "mpeg_preseek", text="MPEG Preseek") + col.prop(strip, "streamindex", text="Stream Index") # TODO, sound??? # end drawing filename @@ -595,7 +615,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel): col.prop(strip, "frame_offset_end", text="End") -class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel): +class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel): bl_label = "Sound" @classmethod @@ -627,8 +647,10 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel): row.prop(strip.sound, "use_memory_cache") + layout.prop(strip, "waveform") layout.prop(strip, "volume") - layout.prop(strip, "attenuation") + layout.prop(strip, "pitch") + layout.prop(strip, "pan") col = layout.column(align=True) col.label(text="Trim Duration:") @@ -636,7 +658,7 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel): col.prop(strip, "animation_offset_end", text="End") -class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel): +class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel): bl_label = "Scene" @classmethod @@ -657,14 +679,20 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel): layout.template_ID(strip, "scene") + scene = strip.scene + if scene: + layout.prop(scene.render, "use_sequencer") + layout.label(text="Camera Override") layout.template_ID(strip, "scene_camera") - sce = strip.scene - layout.label(text="Original frame range: %d-%d (%d)" % (sce.frame_start, sce.frame_end, sce.frame_end - sce.frame_start + 1)) + if scene: + sta = scene.frame_start + end = scene.frame_end + layout.label(text="Original frame range: %d-%d (%d)" % (sta, end, end - sta + 1)) -class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): +class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel): bl_label = "Filter" @classmethod @@ -726,8 +754,8 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): col.prop(strip.color_balance, "invert_gain", text="Inverse") -class SEQUENCER_PT_proxy(SequencerButtonsPanel, bpy.types.Panel): - bl_label = "Proxy" +class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel): + bl_label = "Proxy / Timecode" @classmethod def poll(cls, context): @@ -753,14 +781,30 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, bpy.types.Panel): flow = layout.column_flow() flow.prop(strip, "use_proxy_custom_directory") flow.prop(strip, "use_proxy_custom_file") - if strip.proxy: # TODO - need to add this somehow + 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") + 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") + + col = layout.column() + col.label(text="Build JPEG quality") + col.prop(strip.proxy, "quality") + + if strip.type == "MOVIE": + col = layout.column() + col.label(text="Use timecode index:") + + col.prop(strip.proxy, "timecode") + -class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, bpy.types.Panel): +class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel): bl_label = "Scene Preview/Render" bl_space_type = 'SEQUENCE_EDITOR' bl_region_type = 'UI' @@ -785,7 +829,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, bpy.types.Panel): ''' -class SEQUENCER_PT_view(SequencerButtonsPanel_Output, bpy.types.Panel): +class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel): bl_label = "View Settings" def draw(self, context): |