diff options
Diffstat (limited to 'release/scripts/ui/space_sequencer.py')
-rw-r--r-- | release/scripts/ui/space_sequencer.py | 368 |
1 files changed, 156 insertions, 212 deletions
diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py index 97d84b77e18..ec607629757 100644 --- a/release/scripts/ui/space_sequencer.py +++ b/release/scripts/ui/space_sequencer.py @@ -98,6 +98,10 @@ class SEQUENCER_MT_view(bpy.types.Menu): st = context.space_data layout.column() + + layout.operator("sequencer.properties", icon='MENU_PANEL') + + layout.separator() """ uiBlock *block= uiBeginBlock(C, ar, "seq_viewmenu", UI_EMBOSSP); @@ -127,7 +131,6 @@ class SEQUENCER_MT_view(bpy.types.Menu): menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); """ - layout.separator() if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'): layout.operator("sequencer.view_all", text='View all Sequences') if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'): @@ -140,12 +143,12 @@ class SEQUENCER_MT_view(bpy.types.Menu): layout.operator("sequencer.view_selected") - layout.prop(st, "draw_frames") - layout.prop(st, "show_cframe_indicator") + layout.prop(st, "show_frames") + layout.prop(st, "show_frame_indicator") if st.display_mode == 'IMAGE': - layout.prop(st, "draw_safe_margin") + layout.prop(st, "show_safe_margin") if st.display_mode == 'WAVEFORM': - layout.prop(st, "separate_color_preview") + layout.prop(st, "show_separate_color") layout.separator() layout.prop(st, "use_marker_sync") @@ -309,29 +312,33 @@ class SEQUENCER_MT_strip(bpy.types.Menu): layout.operator("sequencer.swap_data") -class SequencerButtonsPanel(bpy.types.Panel): +class SequencerButtonsPanel(): bl_space_type = 'SEQUENCE_EDITOR' bl_region_type = 'UI' - def has_sequencer(self, context): + @staticmethod + def has_sequencer(context): return (context.space_data.view_type == 'SEQUENCER') or (context.space_data.view_type == 'SEQUENCER_PREVIEW') - def poll(self, context): - return self.has_sequencer(context) and (act_strip(context) is not None) + @classmethod + def poll(cls, context): + return cls.has_sequencer(context) and (act_strip(context) is not None) -class SequencerButtonsPanel_Output(bpy.types.Panel): +class SequencerButtonsPanel_Output(): bl_space_type = 'SEQUENCE_EDITOR' bl_region_type = 'UI' - def has_preview(self, context): + @staticmethod + def has_preview(context): return (context.space_data.view_type == 'PREVIEW') or (context.space_data.view_type == 'SEQUENCER_PREVIEW') - def poll(self, context): - return self.has_preview(context) + @classmethod + def poll(cls, context): + return cls.has_preview(context) -class SEQUENCER_PT_edit(SequencerButtonsPanel): +class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Edit Strip" def draw(self, context): @@ -351,13 +358,12 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel): split = layout.split(percentage=0.3) split.label(text="Blend:") - split.prop(strip, "blend_mode", text="") + split.prop(strip, "blend_type", text="") row = layout.row(align=True) sub = row.row() sub.active = (not strip.mute) - sub.prop(strip, "blend_opacity", text="Opacity", slider=True) - sub = row.row() + sub.prop(strip, "blend_alpha", text="Opacity", slider=True) row.prop(strip, "mute", toggle=True, icon='RESTRICT_VIEW_ON' if strip.mute else 'RESTRICT_VIEW_OFF', text="") row.prop(strip, "lock", toggle=True, icon='LOCKED' if strip.lock else 'UNLOCKED', text="") @@ -366,48 +372,25 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel): sub.enabled = not strip.lock sub.prop(strip, "channel") sub.prop(strip, "frame_start") - sub.prop(strip, "frame_final_length") + sub.prop(strip, "frame_final_duration") col = layout.column(align=True) row = col.row() - row.label(text="Final Length: %s" % bpy.utils.smpte_from_frame(strip.frame_final_length)) + row.label(text="Final Length: %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration)) row = col.row() - row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_length) + row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration) row.label(text="Playhead: %d" % (frame_current - strip.frame_start)) col.label(text="Frame Offset %d:%d" % (strip.frame_offset_start, strip.frame_offset_end)) col.label(text="Frame Still %d:%d" % (strip.frame_still_start, strip.frame_still_end)) -class SEQUENCER_PT_preview(bpy.types.Panel): - bl_label = "Scene Preview/Render" - bl_space_type = 'SEQUENCE_EDITOR' - bl_region_type = 'UI' - - def draw(self, context): - layout = self.layout - render = context.scene.render - - col = layout.column() - col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview") - col = layout.column() - col.active = render.use_sequencer_gl_preview - col.prop(render, "sequencer_gl_preview", text="") - - ''' - col = layout.column() - col.prop(render, "use_sequencer_gl_render", text="Open GL Render") - col = layout.column() - col.active = render.use_sequencer_gl_render - col.prop(render, "sequencer_gl_render", text="") - ''' - - -class SEQUENCER_PT_effect(SequencerButtonsPanel): +class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Effect Strip" - def poll(self, context): - if not self.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -445,19 +428,19 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel): flow.prop(strip, "threshold", slider=True) flow.prop(strip, "clamp", slider=True) flow.prop(strip, "boost_factor") - flow.prop(strip, "blur_distance") + flow.prop(strip, "blur_radius") row = layout.row() row.prop(strip, "quality", slider=True) - row.prop(strip, "only_boost") + row.prop(strip, "use_only_boost") elif strip.type == 'SPEED': layout.prop(strip, "global_speed") flow = layout.column_flow() - flow.prop(strip, "curve_velocity") - flow.prop(strip, "curve_compress_y") - flow.prop(strip, "frame_blending") + flow.prop(strip, "use_curve_velocity") + flow.prop(strip, "use_curve_compress_y") + flow.prop(strip, "use_frame_blend") elif strip.type == 'TRANSFORM': self.draw_panel_transform(strip) @@ -469,10 +452,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel): sub = row.row() sub.scale_x = 2.0 - if not context.screen.animation_playing: - sub.operator("screen.animation_play", text="", icon='PLAY') - else: - sub.operator("screen.animation_play", text="", icon='PAUSE') + 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): @@ -483,9 +463,23 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel): if strip.type == 'SPEED': col.prop(strip, "speed_fader", text="Speed fader") elif strip.type in ('CROSS', 'GAMMA_CROSS', 'PLUGIN', 'WIPE'): - col.prop(strip, "use_effect_default_fade", "Default fade") - if not strip.use_effect_default_fade: + col.prop(strip, "use_default_fade", "Default fade") + if not strip.use_default_fade: col.prop(strip, "effect_fader", text="Effect fader") + + 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") + + 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") + col.prop(strip.crop, "min_y") + col.prop(strip.crop, "max_x") def draw_panel_transform(self, strip): layout = self.layout @@ -501,8 +495,8 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel): layout.separator() col = layout.column(align=True) - col.prop(strip, "uniform_scale") - if (strip.uniform_scale): + col.prop(strip, "use_uniform_scale") + if (strip.use_uniform_scale): col = layout.column(align=True) col.prop(strip, "scale_start_x", text="Scale") else: @@ -518,11 +512,12 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel): col.prop(strip, "rotation_start", text="Rotation") -class SEQUENCER_PT_input(SequencerButtonsPanel): +class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Strip Input" - def poll(self, context): - if not self.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -536,15 +531,41 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'MULTICAM', 'SPEED') - def draw_filename(self, context): - pass - def draw(self, context): layout = self.layout strip = act_strip(context) - self.draw_filename(context) + seq_type = strip.type + + # draw a filename if we have one + if seq_type == 'IMAGE': + split = layout.split(percentage=0.2) + col = split.column() + col.label(text="Path:") + col = split.column() + col.prop(strip, "directory", text="") + + # Current element for the filename + + elem = strip.getStripElem(context.scene.frame_current) + if elem: + split = layout.split(percentage=0.2) + col = split.column() + col.label(text="File:") + col = split.column() + col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback + + elif seq_type == 'MOVIE': + split = layout.split(percentage=0.2) + col = split.column() + col.label(text="Path:") + col = split.column() + col.prop(strip, "filepath", text="") + col.prop(strip, "mpeg_preseek", text="MPEG Preseek") + # TODO, sound??? + # end drawing filename + layout.prop(strip, "use_translation", text="Image Offset:") if strip.use_translation: @@ -555,99 +576,23 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): layout.prop(strip, "use_crop", text="Image Crop:") if strip.use_crop: col = layout.column(align=True) - col.prop(strip.crop, "top") - col.prop(strip.crop, "left") - col.prop(strip.crop, "bottom") - col.prop(strip.crop, "right") + col.prop(strip.crop, "max_y") + col.prop(strip.crop, "min_x") + col.prop(strip.crop, "min_y") + col.prop(strip.crop, "max_x") col = layout.column(align=True) col.label(text="Trim Duration:") - col.prop(strip, "animation_start_offset", text="Start") - col.prop(strip, "animation_end_offset", text="End") - - -class SEQUENCER_PT_input_movie(SEQUENCER_PT_input): - bl_label = "Strip Input" - - def poll(self, context): - if not self.has_sequencer(context): - return False - - strip = act_strip(context) - if not strip: - return False - - return strip.type == 'MOVIE' - - def draw_filename(self, context): - layout = self.layout - - strip = act_strip(context) - - split = layout.split(percentage=0.2) - col = split.column() - col.label(text="Path:") - col = split.column() - col.prop(strip, "filepath", text="") - - -class SEQUENCER_PT_input_image(SEQUENCER_PT_input): - bl_label = "Strip Input" - - def poll(self, context): - if not self.has_sequencer(context): - return False - - strip = act_strip(context) - if not strip: - return False - - return strip.type == 'IMAGE' - - def draw_filename(self, context): - layout = self.layout - - strip = act_strip(context) - - split = layout.split(percentage=0.2) - col = split.column() - col.label(text="Path:") - col = split.column() - col.prop(strip, "directory", text="") - - # Current element for the filename - - elem = strip.getStripElem(context.scene.frame_current) - if elem: - split = layout.split(percentage=0.2) - col = split.column() - col.label(text="File:") - col = split.column() - col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback + col.prop(strip, "frame_offset_start", text="Start") + col.prop(strip, "frame_offset_end", text="End") -class SEQUENCER_PT_input_secondary(SEQUENCER_PT_input): - bl_label = "Strip Input" - - def poll(self, context): - if not self.has_sequencer(context): - return False - - strip = act_strip(context) - if not strip: - return False - - return strip.type in ('SCENE', 'META') - - def draw_filename(self, context): - pass - - -class SEQUENCER_PT_sound(SequencerButtonsPanel): +class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Sound" - def poll(self, context): - if not self.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -672,22 +617,23 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel): else: row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack") - row.prop(strip.sound, "caching") + row.prop(strip.sound, "use_memory_cache") layout.prop(strip, "volume") layout.prop(strip, "attenuation") col = layout.column(align=True) col.label(text="Trim Duration:") - col.prop(strip, "animation_start_offset", text="Start") - col.prop(strip, "animation_end_offset", text="End") + col.prop(strip, "animation_offset_start", text="Start") + col.prop(strip, "animation_offset_end", text="End") -class SEQUENCER_PT_scene(SequencerButtonsPanel): +class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Scene" - def poll(self, context): - if not self.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -707,11 +653,12 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel): layout.template_ID(strip, "scene_camera") -class SEQUENCER_PT_filter(SequencerButtonsPanel): +class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Filter" - def poll(self, context): - if not self.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -736,19 +683,19 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel): row = layout.row() row.label(text="Flip:") - row.prop(strip, "flip_x", text="X") - row.prop(strip, "flip_y", text="Y") + row.prop(strip, "use_flip_x", text="X") + row.prop(strip, "use_flip_y", text="Y") col = layout.column() - col.prop(strip, "reverse_frames", text="Backwards") - col.prop(strip, "de_interlace") + col.prop(strip, "use_reverse_frames", text="Backwards") + col.prop(strip, "use_deinterlace") col = layout.column() col.label(text="Colors:") col.prop(strip, "color_saturation", text="Saturation") - col.prop(strip, "multiply_colors", text="Multiply") - col.prop(strip, "premultiply") - col.prop(strip, "convert_float") + col.prop(strip, "color_multiply", text="Multiply") + col.prop(strip, "use_premultiply") + col.prop(strip, "use_float") layout.prop(strip, "use_color_balance") if strip.use_color_balance and strip.color_balance: # TODO - need to add this somehow @@ -757,22 +704,23 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel): col = row.column() col.template_color_wheel(strip.color_balance, "lift", value_slider=False, cubic=True) col.row().prop(strip.color_balance, "lift") - col.prop(strip.color_balance, "inverse_lift", text="Inverse") + col.prop(strip.color_balance, "invert_lift", text="Inverse") col = row.column() col.template_color_wheel(strip.color_balance, "gamma", value_slider=False, lock_luminosity=True, cubic=True) col.row().prop(strip.color_balance, "gamma") - col.prop(strip.color_balance, "inverse_gamma", text="Inverse") + col.prop(strip.color_balance, "invert_gamma", text="Inverse") col = row.column() col.template_color_wheel(strip.color_balance, "gain", value_slider=False, lock_luminosity=True, cubic=True) col.row().prop(strip.color_balance, "gain") - col.prop(strip.color_balance, "inverse_gain", text="Inverse") + col.prop(strip.color_balance, "invert_gain", text="Inverse") -class SEQUENCER_PT_proxy(SequencerButtonsPanel): +class SEQUENCER_PT_proxy(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Proxy" - def poll(self, context): - if not self.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -792,16 +740,40 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel): strip = act_strip(context) flow = layout.column_flow() - flow.prop(strip, "proxy_custom_directory") - flow.prop(strip, "proxy_custom_file") + 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_custom_directory and not strip.proxy_custom_file: + if strip.proxy_custom_directory and not strip.use_proxy_custom_file: flow.prop(strip.proxy, "directory") - if strip.proxy_custom_file: + if strip.use_proxy_custom_file: flow.prop(strip.proxy, "filepath") -class SEQUENCER_PT_view(SequencerButtonsPanel_Output): +class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, bpy.types.Panel): + bl_label = "Scene Preview/Render" + bl_space_type = 'SEQUENCE_EDITOR' + bl_region_type = 'UI' + + def draw(self, context): + layout = self.layout + render = context.scene.render + + col = layout.column() + col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview") + col = layout.column() + col.active = render.use_sequencer_gl_preview + col.prop(render, "sequencer_gl_preview", text="") + + ''' + col = layout.column() + col.prop(render, "use_sequencer_gl_render", text="Open GL Render") + col = layout.column() + col.active = render.use_sequencer_gl_render + col.prop(render, "sequencer_gl_render", text="") + ''' + + +class SEQUENCER_PT_view(SequencerButtonsPanel_Output, bpy.types.Panel): bl_label = "View Settings" def draw(self, context): @@ -812,45 +784,17 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output): col = layout.column() if st.display_mode == 'IMAGE': col.prop(st, "draw_overexposed") # text="Zebra" - col.prop(st, "draw_safe_margin") + col.prop(st, "show_safe_margin") if st.display_mode == 'WAVEFORM': - col.prop(st, "separate_color_preview") + col.prop(st, "show_separate_color") col.prop(st, "proxy_render_size") -classes = [ - SEQUENCER_HT_header, # header/menu classes - SEQUENCER_MT_view, - SEQUENCER_MT_view_toggle, - SEQUENCER_MT_select, - SEQUENCER_MT_marker, - SEQUENCER_MT_add, - SEQUENCER_MT_add_effect, - SEQUENCER_MT_strip, - - SEQUENCER_PT_edit, # sequencer panels - SEQUENCER_PT_preview, - SEQUENCER_PT_effect, - SEQUENCER_PT_input_movie, - SEQUENCER_PT_input_image, - SEQUENCER_PT_input_secondary, - SEQUENCER_PT_sound, - SEQUENCER_PT_scene, - SEQUENCER_PT_filter, - SEQUENCER_PT_proxy, - - SEQUENCER_PT_view] # view panels - - def register(): - register = bpy.types.register - for cls in classes: - register(cls) + pass def unregister(): - unregister = bpy.types.unregister - for cls in classes: - unregister(cls) + pass if __name__ == "__main__": register() |