1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
21 from bpy.types import Header, Menu, Panel
22 from rna_prop_ui import PropertyPanel
23 from bl_ui.properties_grease_pencil_common import GreasePencilDataPanel, GreasePencilToolsPanel
24 from bpy.app.translations import pgettext_iface as iface_
27 def act_strip(context):
29 return context.scene.sequence_editor.active_strip
30 except AttributeError:
34 def draw_color_balance(layout, color_balance):
36 col.label(text="Lift:")
37 col.template_color_picker(color_balance, "lift", value_slider=True, cubic=True)
39 row.prop(color_balance, "lift", text="")
40 row.prop(color_balance, "invert_lift", text="Inverse")
43 col.label(text="Gamma:")
44 col.template_color_picker(color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True)
46 row.prop(color_balance, "gamma", text="")
47 row.prop(color_balance, "invert_gamma", text="Inverse")
50 col.label(text="Gain:")
51 col.template_color_picker(color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True)
53 row.prop(color_balance, "gain", text="")
54 row.prop(color_balance, "invert_gain", text="Inverse")
57 class SEQUENCER_HT_header(Header):
58 bl_space_type = 'SEQUENCE_EDITOR'
60 def draw(self, context):
63 st = context.space_data
66 row = layout.row(align=True)
69 SEQUENCER_MT_editor_menus.draw_collapsible(context, layout)
71 row = layout.row(align=True)
72 row.prop(scene, "use_preview_range", text="", toggle=True)
73 row.prop(scene, "lock_frame_selection_to_range", text="", toggle=True)
75 layout.prop(st, "view_type", expand=True, text="")
77 if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
78 layout.prop(st, "display_mode", expand=True, text="")
80 if st.view_type == 'SEQUENCER':
81 row = layout.row(align=True)
82 row.operator("sequencer.copy", text="", icon='COPYDOWN')
83 row.operator("sequencer.paste", text="", icon='PASTEDOWN')
86 layout.operator("sequencer.refresh_all")
87 layout.prop(st, "show_backdrop")
89 if st.view_type == 'SEQUENCER_PREVIEW':
91 layout.operator("sequencer.refresh_all")
93 layout.prop(st, "preview_channels", expand=True, text="")
94 layout.prop(st, "display_channel", text="Channel")
96 ed = context.scene.sequence_editor
98 row = layout.row(align=True)
99 row.prop(ed, "show_overlay", text="", icon='GHOST_ENABLED')
101 row.prop(ed, "overlay_frame", text="")
102 row.prop(ed, "use_overlay_lock", text="", icon='LOCKED')
105 row.prop(st, "overlay_type", text="")
107 if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
108 gpd = context.gpencil_data
109 toolsettings = context.tool_settings
111 # Proportional editing
112 if gpd and gpd.use_stroke_edit_mode:
113 row = layout.row(align=True)
114 row.prop(toolsettings, "proportional_edit", icon_only=True)
115 if toolsettings.proportional_edit != 'DISABLED':
116 row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
118 row = layout.row(align=True)
119 row.operator("render.opengl", text="", icon='RENDER_STILL').sequencer = True
120 props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION')
121 props.animation = True
122 props.sequencer = True
124 layout.template_running_jobs()
127 class SEQUENCER_MT_editor_menus(Menu):
128 bl_idname = "SEQUENCER_MT_editor_menus"
131 def draw(self, context):
132 self.draw_menus(self.layout, context)
135 def draw_menus(layout, context):
136 st = context.space_data
138 layout.menu("SEQUENCER_MT_view")
140 if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
141 layout.menu("SEQUENCER_MT_select")
142 layout.menu("SEQUENCER_MT_marker")
143 layout.menu("SEQUENCER_MT_add")
144 layout.menu("SEQUENCER_MT_frame")
145 layout.menu("SEQUENCER_MT_strip")
148 class SEQUENCER_MT_view_toggle(Menu):
149 bl_label = "View Type"
151 def draw(self, context):
154 layout.operator("sequencer.view_toggle").type = 'SEQUENCER'
155 layout.operator("sequencer.view_toggle").type = 'PREVIEW'
156 layout.operator("sequencer.view_toggle").type = 'SEQUENCER_PREVIEW'
159 class SEQUENCER_MT_view(Menu):
162 def draw(self, context):
165 st = context.space_data
166 is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
167 is_sequencer_view = st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}
169 if st.view_type == 'PREVIEW':
170 # Specifying the REGION_PREVIEW context is needed in preview-only
171 # mode, else the lookup for the shortcut will fail in
172 # wm_keymap_item_find_props() (see #32595).
173 layout.operator_context = 'INVOKE_REGION_PREVIEW'
174 layout.operator("sequencer.properties", icon='MENU_PANEL')
175 layout.operator_context = 'INVOKE_DEFAULT'
179 if is_sequencer_view:
180 layout.operator("sequencer.view_all", text="View all Sequences")
181 layout.operator("sequencer.view_selected")
183 layout.operator_context = 'INVOKE_REGION_PREVIEW'
184 layout.operator("sequencer.view_all_preview", text="Fit preview in window")
188 ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
191 layout.operator("sequencer.view_zoom_ratio", text=iface_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
195 layout.operator_context = 'INVOKE_DEFAULT'
197 # # XXX, invokes in the header view
198 # layout.operator("sequencer.view_ghost_border", text="Overlay Border")
200 if is_sequencer_view:
201 layout.prop(st, "show_seconds")
202 layout.prop(st, "show_frame_indicator")
203 layout.prop(st, "show_strip_offset")
205 layout.prop_menu_enum(st, "waveform_draw_type")
208 if st.display_mode == 'IMAGE':
209 layout.prop(st, "show_safe_areas")
210 elif st.display_mode == 'WAVEFORM':
211 layout.prop(st, "show_separate_color")
215 if is_sequencer_view:
216 layout.prop(st, "use_marker_sync")
219 layout.operator("screen.area_dupli")
220 layout.operator("screen.screen_full_area", text="Toggle Maximize Area")
221 layout.operator("screen.screen_full_area").use_hide_panels = True
224 class SEQUENCER_MT_select(Menu):
227 def draw(self, context):
230 layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
231 layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
232 op = layout.operator("sequencer.select", text="All strips to the Left")
233 op.left_right = 'LEFT'
234 op.linked_time = True
235 op = layout.operator("sequencer.select", text="All strips to the Right")
236 op.left_right = 'RIGHT'
237 op.linked_time = True
240 layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
241 layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
242 layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT'
244 layout.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
245 layout.operator("sequencer.select_linked")
246 layout.operator("sequencer.select_all").action = 'TOGGLE'
247 layout.operator("sequencer.select_all", text="Inverse").action = 'INVERT'
250 class SEQUENCER_MT_marker(Menu):
253 def draw(self, context):
256 from bl_ui.space_time import marker_menu_generic
257 marker_menu_generic(layout)
260 class SEQUENCER_MT_change(Menu):
263 def draw(self, context):
266 layout.operator_context = 'INVOKE_REGION_WIN'
268 layout.operator_menu_enum("sequencer.change_effect_input", "swap")
269 layout.operator_menu_enum("sequencer.change_effect_type", "type")
270 layout.operator("sequencer.change_path", text="Path/Files")
273 class SEQUENCER_MT_frame(Menu):
276 def draw(self, context):
279 layout.operator("anim.previewrange_clear")
280 layout.operator("anim.previewrange_set")
283 class SEQUENCER_MT_add(Menu):
286 def draw(self, context):
289 layout.operator_context = 'INVOKE_REGION_WIN'
291 if len(bpy.data.scenes) > 10:
292 layout.operator_context = 'INVOKE_DEFAULT'
293 layout.operator("sequencer.scene_strip_add", text="Scene...")
295 layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...")
297 if len(bpy.data.movieclips) > 10:
298 layout.operator_context = 'INVOKE_DEFAULT'
299 layout.operator("sequencer.movieclip_strip_add", text="Clips...")
301 layout.operator_menu_enum("sequencer.movieclip_strip_add", "clip", text="Clip...")
303 if len(bpy.data.masks) > 10:
304 layout.operator_context = 'INVOKE_DEFAULT'
305 layout.operator("sequencer.mask_strip_add", text="Masks...")
307 layout.operator_menu_enum("sequencer.mask_strip_add", "mask", text="Mask...")
309 layout.operator("sequencer.movie_strip_add", text="Movie")
310 layout.operator("sequencer.image_strip_add", text="Image")
311 layout.operator("sequencer.sound_strip_add", text="Sound")
313 layout.menu("SEQUENCER_MT_add_effect")
316 class SEQUENCER_MT_add_effect(Menu):
317 bl_label = "Effect Strip..."
319 def draw(self, context):
322 layout.operator_context = 'INVOKE_REGION_WIN'
324 layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
325 layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT'
326 layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
327 layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
328 layout.operator("sequencer.effect_strip_add", text="Cross").type = 'CROSS'
329 layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS'
330 layout.operator("sequencer.effect_strip_add", text="Gaussian Blur").type = 'GAUSSIAN_BLUR'
331 layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY'
332 layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP'
333 layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE'
334 layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW'
335 layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM'
336 layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
337 layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
338 layout.operator("sequencer.effect_strip_add", text="Multicam Selector").type = 'MULTICAM'
339 layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
342 class SEQUENCER_MT_strip(Menu):
345 def draw(self, context):
348 layout.operator_context = 'INVOKE_REGION_WIN'
350 layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
351 layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
352 layout.operator("sequencer.gap_remove").all = False
353 layout.operator("sequencer.gap_insert")
355 # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
358 layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
359 layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
360 layout.operator("sequencer.slip", text="Slip Strip Contents")
361 layout.operator("sequencer.images_separate")
362 layout.operator("sequencer.offset_clear")
363 layout.operator("sequencer.deinterlace_selected_movies")
364 layout.operator("sequencer.rebuild_proxy")
367 layout.operator("sequencer.duplicate_move")
368 layout.operator("sequencer.delete")
370 strip = act_strip(context)
375 # XXX note strip.type is never equal to 'EFFECT', look at seq_type_items within rna_sequencer.c
376 if stype == 'EFFECT':
379 # layout.operator("sequencer.effect_change")
380 # layout.operator("sequencer.effect_reassign_inputs")
381 elif stype == 'IMAGE':
383 # layout.operator("sequencer.image_change")
384 layout.operator("sequencer.rendersize")
385 elif stype == 'SCENE':
388 # layout.operator("sequencer.scene_change", text="Change Scene")
389 elif stype == 'MOVIE':
391 # layout.operator("sequencer.movie_change")
392 layout.operator("sequencer.rendersize")
393 elif stype == 'SOUND':
395 layout.operator("sequencer.crossfade_sounds")
399 layout.operator("sequencer.meta_make")
400 layout.operator("sequencer.meta_separate")
402 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
404 # uiItemO(layout, NULL, 0, "sequencer.meta_toggle");
408 layout.operator("sequencer.reload", text="Reload Strips")
409 layout.operator("sequencer.reload", text="Reload Strips and Adjust Length").adjust_length = True
410 layout.operator("sequencer.reassign_inputs")
411 layout.operator("sequencer.swap_inputs")
414 layout.operator("sequencer.lock")
415 layout.operator("sequencer.unlock")
416 layout.operator("sequencer.mute").unselected = False
417 layout.operator("sequencer.unmute").unselected = False
419 layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
421 layout.operator("sequencer.snap")
423 layout.operator_menu_enum("sequencer.swap", "side")
427 layout.operator("sequencer.swap_data")
428 layout.menu("SEQUENCER_MT_change")
431 class SequencerButtonsPanel:
432 bl_space_type = 'SEQUENCE_EDITOR'
433 bl_region_type = 'UI'
436 def has_sequencer(context):
437 return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
440 def poll(cls, context):
441 return cls.has_sequencer(context) and (act_strip(context) is not None)
444 class SequencerButtonsPanel_Output:
445 bl_space_type = 'SEQUENCE_EDITOR'
446 bl_region_type = 'UI'
449 def has_preview(context):
450 st = context.space_data
451 return (st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}) or st.show_backdrop
454 def poll(cls, context):
455 return cls.has_preview(context)
458 class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
459 bl_label = "Edit Strip"
461 def draw(self, context):
464 scene = context.scene
465 frame_current = scene.frame_current
466 strip = act_strip(context)
468 split = layout.split(percentage=0.3)
469 split.label(text="Name:")
470 split.prop(strip, "name", text="")
472 split = layout.split(percentage=0.3)
473 split.label(text="Type:")
474 split.prop(strip, "type", text="")
476 if strip.type not in {'SOUND'}:
477 split = layout.split(percentage=0.3)
478 split.label(text="Blend:")
479 split.prop(strip, "blend_type", text="")
481 row = layout.row(align=True)
482 sub = row.row(align=True)
483 sub.active = (not strip.mute)
484 sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
485 row.prop(strip, "mute", toggle=True, icon_only=True)
486 row.prop(strip, "lock", toggle=True, icon_only=True)
488 row = layout.row(align=True)
489 row.prop(strip, "mute", toggle=True, icon_only=True)
490 row.prop(strip, "lock", toggle=True, icon_only=True)
492 col = layout.column()
494 sub.enabled = not strip.lock
495 sub.prop(strip, "channel")
496 sub.prop(strip, "frame_start")
497 sub.prop(strip, "frame_final_duration")
499 col = layout.column(align=True)
500 row = col.row(align=True)
501 row.label(text=iface_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
503 row = col.row(align=True)
504 row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
505 row.label(text=iface_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
507 col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
509 col.label(text=iface_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
513 if strip.type == 'IMAGE':
514 elem = strip.strip_elem_from_frame(frame_current)
515 elif strip.type == 'MOVIE':
516 elem = strip.elements[0]
518 if elem and elem.orig_width > 0 and elem.orig_height > 0:
519 col.label(text=iface_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
521 col.label(text="Original Dimension: None")
524 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
525 bl_label = "Effect Strip"
528 def poll(cls, context):
529 if not cls.has_sequencer(context):
532 strip = act_strip(context)
536 return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
537 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
538 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
539 'MULTICAM', 'GAUSSIAN_BLUR'}
541 def draw(self, context):
544 strip = act_strip(context)
546 if strip.input_count > 0:
547 col = layout.column()
548 col.prop(strip, "input_1")
549 if strip.input_count > 1:
550 col.prop(strip, "input_2")
552 if strip.type == 'COLOR':
553 layout.prop(strip, "color")
555 elif strip.type == 'WIPE':
556 col = layout.column()
557 col.prop(strip, "transition_type")
558 col.label(text="Direction:")
559 col.row().prop(strip, "direction", expand=True)
561 col = layout.column()
562 col.prop(strip, "blur_width", slider=True)
563 if strip.transition_type in {'SINGLE', 'DOUBLE'}:
564 col.prop(strip, "angle")
566 elif strip.type == 'GLOW':
567 flow = layout.column_flow()
568 flow.prop(strip, "threshold", slider=True)
569 flow.prop(strip, "clamp", slider=True)
570 flow.prop(strip, "boost_factor")
571 flow.prop(strip, "blur_radius")
574 row.prop(strip, "quality", slider=True)
575 row.prop(strip, "use_only_boost")
577 elif strip.type == 'SPEED':
578 layout.prop(strip, "use_default_fade", "Stretch to input strip length")
579 if not strip.use_default_fade:
580 layout.prop(strip, "use_as_speed")
581 if strip.use_as_speed:
582 layout.prop(strip, "speed_factor")
584 layout.prop(strip, "speed_factor", text="Frame number")
585 layout.prop(strip, "scale_to_length")
587 elif strip.type == 'TRANSFORM':
589 col = layout.column()
591 col.prop(strip, "interpolation")
592 col.prop(strip, "translation_unit")
593 col = layout.column(align=True)
594 col.label(text="Position:")
595 col.prop(strip, "translate_start_x", text="X")
596 col.prop(strip, "translate_start_y", text="Y")
600 col = layout.column(align=True)
601 col.prop(strip, "use_uniform_scale")
602 if strip.use_uniform_scale:
603 col = layout.column(align=True)
604 col.prop(strip, "scale_start_x", text="Scale")
606 col = layout.column(align=True)
607 col.label(text="Scale:")
608 col.prop(strip, "scale_start_x", text="X")
609 col.prop(strip, "scale_start_y", text="Y")
613 col = layout.column(align=True)
614 col.label(text="Rotation:")
615 col.prop(strip, "rotation_start", text="Rotation")
617 elif strip.type == 'MULTICAM':
618 layout.prop(strip, "multicam_source")
620 row = layout.row(align=True)
621 sub = row.row(align=True)
624 sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY')
627 for i in range(1, strip.channel):
628 row.operator("sequencer.cut_multicam", text="%d" % i).camera = i
630 col = layout.column(align=True)
631 if strip.type == 'SPEED':
632 col.prop(strip, "multiply_speed")
633 elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}:
634 col.prop(strip, "use_default_fade", "Default fade")
635 if not strip.use_default_fade:
636 col.prop(strip, "effect_fader", text="Effect fader")
637 elif strip.type == 'GAUSSIAN_BLUR':
638 col.prop(strip, "size_x")
639 col.prop(strip, "size_y")
642 class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
643 bl_label = "Strip Input"
646 def poll(cls, context):
647 if not cls.has_sequencer(context):
650 strip = act_strip(context)
654 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'META',
655 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
656 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
657 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
658 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
660 def draw(self, context):
662 scene = context.scene
664 strip = act_strip(context)
666 seq_type = strip.type
668 # draw a filename if we have one
669 if seq_type == 'IMAGE':
670 split = layout.split(percentage=0.2)
671 split.label(text="Path:")
672 split.prop(strip, "directory", text="")
674 # Current element for the filename
676 elem = strip.strip_elem_from_frame(scene.frame_current)
678 split = layout.split(percentage=0.2)
679 split.label(text="File:")
680 split.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
682 layout.prop(strip.colorspace_settings, "name")
683 layout.prop(strip, "alpha_mode")
685 layout.operator("sequencer.change_path")
687 elif seq_type == 'MOVIE':
688 split = layout.split(percentage=0.2)
689 split.label(text="Path:")
690 split.prop(strip, "filepath", text="")
692 layout.prop(strip.colorspace_settings, "name")
694 layout.prop(strip, "mpeg_preseek")
695 layout.prop(strip, "stream_index")
697 layout.prop(strip, "use_translation", text="Image Offset")
698 if strip.use_translation:
699 col = layout.column(align=True)
700 col.prop(strip.transform, "offset_x", text="X")
701 col.prop(strip.transform, "offset_y", text="Y")
703 layout.prop(strip, "use_crop", text="Image Crop")
705 col = layout.column(align=True)
706 col.prop(strip.crop, "max_y")
707 col.prop(strip.crop, "min_x")
708 col.prop(strip.crop, "min_y")
709 col.prop(strip.crop, "max_x")
711 if not isinstance(strip, bpy.types.EffectSequence):
712 col = layout.column(align=True)
713 col.label(text="Trim Duration (hard):")
714 col.prop(strip, "animation_offset_start", text="Start")
715 col.prop(strip, "animation_offset_end", text="End")
717 col = layout.column(align=True)
718 col.label(text="Trim Duration (soft):")
719 col.prop(strip, "frame_offset_start", text="Start")
720 col.prop(strip, "frame_offset_end", text="End")
722 if scene.render.use_multiview and seq_type in {'IMAGE', 'MOVIE'}:
723 layout.prop(strip, "use_multiview")
725 col = layout.column()
726 col.active = strip.use_multiview
728 col.label(text="Views Format:")
729 col.row().prop(strip, "views_format", expand=True)
732 box.active = strip.views_format == 'STEREO_3D'
733 box.template_image_stereo_3d(strip.stereo_3d_format)
736 class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
740 def poll(cls, context):
741 if not cls.has_sequencer(context):
744 strip = act_strip(context)
748 return (strip.type == 'SOUND')
750 def draw(self, context):
753 st = context.space_data
754 strip = act_strip(context)
757 # TODO: add support to handle SOUND datablock in sequencer soundstrips... For now, hide this useless thing!
758 # layout.template_ID(strip, "sound", open="sound.open")
761 layout.prop(strip, "filepath", text="")
763 if sound is not None:
765 if sound.packed_file:
766 row.operator("sound.unpack", icon='PACKAGE', text="Unpack")
768 row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack")
770 row.prop(sound, "use_memory_cache")
772 if st.waveform_draw_type == 'DEFAULT_WAVEFORMS':
773 layout.prop(strip, "show_waveform")
775 layout.prop(strip, "volume")
776 layout.prop(strip, "pitch")
777 layout.prop(strip, "pan")
779 col = layout.column(align=True)
780 col.label(text="Trim Duration (hard):")
781 col.prop(strip, "animation_offset_start", text="Start")
782 col.prop(strip, "animation_offset_end", text="End")
784 col = layout.column(align=True)
785 col.label(text="Trim Duration (soft):")
786 col.prop(strip, "frame_offset_start", text="Start")
787 col.prop(strip, "frame_offset_end", text="End")
790 class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
794 def poll(cls, context):
795 if not cls.has_sequencer(context):
798 strip = act_strip(context)
802 return (strip.type == 'SCENE')
804 def draw(self, context):
807 strip = act_strip(context)
809 layout.template_ID(strip, "scene")
813 layout.label(text="Camera Override")
814 layout.template_ID(strip, "scene_camera")
816 layout.prop(strip, "use_grease_pencil", text="Show Grease Pencil")
819 layout.prop(scene, "audio_volume", text="Audio Volume")
821 sta = scene.frame_start
822 end = scene.frame_end
823 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
826 class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
830 def poll(cls, context):
831 if not cls.has_sequencer(context):
834 strip = act_strip(context)
838 return (strip.type == 'MASK')
840 def draw(self, context):
843 strip = act_strip(context)
845 layout.template_ID(strip, "mask")
850 sta = mask.frame_start
852 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
855 class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
859 def poll(cls, context):
860 if not cls.has_sequencer(context):
863 strip = act_strip(context)
867 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'MASK',
868 'META', 'ADD', 'SUBTRACT', 'ALPHA_OVER',
869 'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY',
870 'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
871 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
873 def draw(self, context):
876 strip = act_strip(context)
878 col = layout.column()
879 col.label(text="Video:")
880 col.prop(strip, "strobe")
882 if strip.type == 'MOVIECLIP':
883 col = layout.column()
884 col.label(text="Tracker:")
885 col.prop(strip, "stabilize2d")
887 col = layout.column()
888 col.label(text="Distortion:")
889 col.prop(strip, "undistort")
891 split = layout.split(percentage=0.65)
894 col.prop(strip, "use_reverse_frames", text="Backwards")
895 col.prop(strip, "use_deinterlace")
898 col.label(text="Flip:")
899 col.prop(strip, "use_flip_x", text="X")
900 col.prop(strip, "use_flip_y", text="Y")
902 col = layout.column()
903 col.label(text="Colors:")
904 col.prop(strip, "color_saturation", text="Saturation")
905 col.prop(strip, "color_multiply", text="Multiply")
906 col.prop(strip, "use_float")
909 class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
910 bl_label = "Proxy / Timecode"
913 def poll(cls, context):
914 if not cls.has_sequencer(context):
917 strip = act_strip(context)
921 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'META', 'MULTICAM'}
923 def draw_header(self, context):
924 strip = act_strip(context)
926 self.layout.prop(strip, "use_proxy", text="")
928 def draw(self, context):
931 sequencer = context.scene.sequence_editor
933 strip = act_strip(context)
938 flow = layout.column_flow()
939 flow.prop(sequencer, "proxy_storage")
940 if sequencer.proxy_storage == 'PROJECT':
941 flow.prop(sequencer, "proxy_dir")
943 flow.prop(proxy, "use_proxy_custom_directory")
944 flow.prop(proxy, "use_proxy_custom_file")
946 if proxy.use_proxy_custom_directory and not proxy.use_proxy_custom_file:
947 flow.prop(proxy, "directory")
948 if proxy.use_proxy_custom_file:
949 flow.prop(proxy, "filepath")
951 layout.label("Enabled Proxies:")
960 if (proxy.build_100):
964 if (proxy.use_overwrite):
965 layout.label("Overwrite On")
967 layout.label("Overwrite Off")
969 col = layout.column()
970 col.label(text="Build JPEG quality")
971 col.prop(proxy, "quality")
973 if strip.type == 'MOVIE':
974 col = layout.column()
975 col.label(text="Use timecode index:")
977 col.prop(proxy, "timecode")
979 col = layout.column()
980 col.operator("sequencer.enable_proxies")
981 col.operator("sequencer.rebuild_proxy")
984 class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
985 bl_label = "Scene Preview/Render"
986 bl_space_type = 'SEQUENCE_EDITOR'
987 bl_region_type = 'UI'
989 def draw(self, context):
992 render = context.scene.render
994 col = layout.column()
995 col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
996 col = layout.column()
997 #col.active = render.use_sequencer_gl_preview
998 col.prop(render, "sequencer_gl_preview", text="")
1001 row.active = render.sequencer_gl_preview == 'SOLID'
1002 row.prop(render, "use_sequencer_gl_textured_solid")
1005 class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
1006 bl_label = "View Settings"
1008 def draw(self, context):
1009 layout = self.layout
1011 st = context.space_data
1013 col = layout.column()
1014 if st.display_mode == 'IMAGE':
1015 col.prop(st, "draw_overexposed")
1018 elif st.display_mode == 'WAVEFORM':
1019 col.prop(st, "show_separate_color")
1021 col = layout.column()
1023 col.prop(st, "proxy_render_size")
1026 class SEQUENCER_PT_view_safe_areas(SequencerButtonsPanel_Output, Panel):
1027 bl_label = "Safe Areas"
1028 bl_options = {'DEFAULT_CLOSED'}
1031 def poll(cls, context):
1032 st = context.space_data
1033 is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
1034 return is_preview and (st.display_mode == 'IMAGE')
1036 def draw_header(self, context):
1037 st = context.space_data
1039 self.layout.prop(st, "show_safe_areas", text="")
1041 def draw(self, context):
1042 from bl_ui.properties_data_camera import draw_display_safe_settings
1044 layout = self.layout
1045 st = context.space_data
1046 safe_data = context.scene.safe_areas
1048 draw_display_safe_settings(layout, safe_data, st)
1051 class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
1052 bl_label = "Modifiers"
1054 def draw(self, context):
1055 layout = self.layout
1057 strip = act_strip(context)
1058 sequencer = context.scene.sequence_editor
1060 layout.prop(strip, "use_linear_modifiers")
1062 layout.operator_menu_enum("sequencer.strip_modifier_add", "type")
1064 for mod in strip.modifiers:
1068 row.prop(mod, "show_expanded", text="", emboss=False)
1069 row.prop(mod, "name", text="")
1071 row.prop(mod, "mute", text="")
1073 sub = row.row(align=True)
1074 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_UP')
1075 props.name = mod.name
1076 props.direction = 'UP'
1077 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_DOWN')
1078 props.name = mod.name
1079 props.direction = 'DOWN'
1081 row.operator("sequencer.strip_modifier_remove", text="", icon='X', emboss=False).name = mod.name
1083 if mod.show_expanded:
1085 row.prop(mod, "input_mask_type", expand=True)
1087 if mod.input_mask_type == 'STRIP':
1088 sequences_object = sequencer
1089 if sequencer.meta_stack:
1090 sequences_object = sequencer.meta_stack[-1]
1091 box.prop_search(mod, "input_mask_strip", sequences_object, "sequences", text="Mask")
1093 box.prop(mod, "input_mask_id")
1095 if mod.type == 'COLOR_BALANCE':
1096 box.prop(mod, "color_multiply")
1097 draw_color_balance(box, mod.color_balance)
1098 elif mod.type == 'CURVES':
1099 box.template_curve_mapping(mod, "curve_mapping", type='COLOR')
1100 elif mod.type == 'HUE_CORRECT':
1101 box.template_curve_mapping(mod, "curve_mapping", type='HUE')
1102 elif mod.type == 'BRIGHT_CONTRAST':
1104 col.prop(mod, "bright")
1105 col.prop(mod, "contrast")
1108 class SEQUENCER_PT_grease_pencil(GreasePencilDataPanel, SequencerButtonsPanel_Output, Panel):
1109 bl_space_type = 'SEQUENCE_EDITOR'
1110 bl_region_type = 'UI'
1112 # NOTE: this is just a wrapper around the generic GP Panel
1113 # But, it should only show up when there are images in the preview region
1116 class SEQUENCER_PT_grease_pencil_tools(GreasePencilToolsPanel, SequencerButtonsPanel_Output, Panel):
1117 bl_space_type = 'SEQUENCE_EDITOR'
1118 bl_region_type = 'UI'
1120 # NOTE: this is just a wrapper around the generic GP tools panel
1121 # It contains access to some essential tools usually found only in
1122 # toolbar, which doesn't exist here...
1125 class SEQUENCER_PT_custom_props(SequencerButtonsPanel, PropertyPanel, Panel):
1126 COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
1127 _context_path = "scene.sequence_editor.active_strip"
1128 _property_type = (bpy.types.Sequence,)
1131 if __name__ == "__main__": # only for live edit.
1132 bpy.utils.register_module(__name__)