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_context = 'INVOKE_REGION_WIN'
181 layout.operator("sequencer.view_all", text="View all Sequences")
182 layout.operator("sequencer.view_selected")
183 layout.operator_context = 'INVOKE_DEFAULT'
185 layout.operator_context = 'INVOKE_REGION_PREVIEW'
186 layout.operator("sequencer.view_all_preview", text="Fit preview in window")
190 ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
193 layout.operator("sequencer.view_zoom_ratio", text=iface_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
197 layout.operator_context = 'INVOKE_DEFAULT'
199 # # XXX, invokes in the header view
200 # layout.operator("sequencer.view_ghost_border", text="Overlay Border")
202 if is_sequencer_view:
203 layout.prop(st, "show_seconds")
204 layout.prop(st, "show_frame_indicator")
205 layout.prop(st, "show_strip_offset")
207 layout.prop_menu_enum(st, "waveform_draw_type")
210 if st.display_mode == 'IMAGE':
211 layout.prop(st, "show_safe_areas")
212 layout.prop(st, "show_metadata")
213 elif st.display_mode == 'WAVEFORM':
214 layout.prop(st, "show_separate_color")
218 if is_sequencer_view:
219 layout.prop(st, "use_marker_sync")
222 layout.operator("screen.area_dupli")
223 layout.operator("screen.screen_full_area", text="Toggle Maximize Area")
224 layout.operator("screen.screen_full_area").use_hide_panels = True
227 class SEQUENCER_MT_select(Menu):
230 def draw(self, context):
233 layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
234 layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
235 props = layout.operator("sequencer.select", text="All strips to the Left")
236 props.left_right = 'LEFT'
237 props.linked_time = True
238 props = layout.operator("sequencer.select", text="All strips to the Right")
239 props.left_right = 'RIGHT'
240 props.linked_time = True
243 layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
244 layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
245 layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT'
247 layout.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
248 layout.operator("sequencer.select_linked")
249 layout.operator("sequencer.select_less")
250 layout.operator("sequencer.select_more")
251 layout.operator("sequencer.select_all").action = 'TOGGLE'
252 layout.operator("sequencer.select_all", text="Inverse").action = 'INVERT'
255 class SEQUENCER_MT_marker(Menu):
258 def draw(self, context):
261 from bl_ui.space_time import marker_menu_generic
262 marker_menu_generic(layout)
265 class SEQUENCER_MT_change(Menu):
268 def draw(self, context):
270 strip = act_strip(context)
272 layout.operator_context = 'INVOKE_REGION_WIN'
274 layout.operator_menu_enum("sequencer.change_effect_input", "swap")
275 layout.operator_menu_enum("sequencer.change_effect_type", "type")
276 prop = layout.operator("sequencer.change_path", text="Path/Files")
282 prop.filter_image = True;
283 elif stype == 'MOVIE':
284 prop.filter_movie = True;
285 elif stype == 'SOUND':
286 prop.filter_sound = True;
289 class SEQUENCER_MT_frame(Menu):
292 def draw(self, context):
295 layout.operator("anim.previewrange_clear")
296 layout.operator("anim.previewrange_set")
299 class SEQUENCER_MT_add(Menu):
302 def draw(self, context):
305 layout.operator_context = 'INVOKE_REGION_WIN'
307 if len(bpy.data.scenes) > 10:
308 layout.operator_context = 'INVOKE_DEFAULT'
309 layout.operator("sequencer.scene_strip_add", text="Scene...")
311 layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...")
313 if len(bpy.data.movieclips) > 10:
314 layout.operator_context = 'INVOKE_DEFAULT'
315 layout.operator("sequencer.movieclip_strip_add", text="Clips...")
317 layout.operator_menu_enum("sequencer.movieclip_strip_add", "clip", text="Clip...")
319 if len(bpy.data.masks) > 10:
320 layout.operator_context = 'INVOKE_DEFAULT'
321 layout.operator("sequencer.mask_strip_add", text="Masks...")
323 layout.operator_menu_enum("sequencer.mask_strip_add", "mask", text="Mask...")
325 layout.operator("sequencer.movie_strip_add", text="Movie")
326 layout.operator("sequencer.image_strip_add", text="Image")
327 layout.operator("sequencer.sound_strip_add", text="Sound")
329 layout.menu("SEQUENCER_MT_add_effect")
332 class SEQUENCER_MT_add_effect(Menu):
333 bl_label = "Effect Strip..."
335 def draw(self, context):
338 layout.operator_context = 'INVOKE_REGION_WIN'
340 layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
341 layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT'
342 layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
343 layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
344 layout.operator("sequencer.effect_strip_add", text="Cross").type = 'CROSS'
345 layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS'
346 layout.operator("sequencer.effect_strip_add", text="Gaussian Blur").type = 'GAUSSIAN_BLUR'
347 layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY'
348 layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP'
349 layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE'
350 layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW'
351 layout.operator("sequencer.effect_strip_add", text="Text").type = 'TEXT'
352 layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM'
353 layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
354 layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
355 layout.operator("sequencer.effect_strip_add", text="Multicam Selector").type = 'MULTICAM'
356 layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
359 class SEQUENCER_MT_strip(Menu):
362 def draw(self, context):
365 layout.operator_context = 'INVOKE_REGION_WIN'
367 layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
368 layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
369 layout.operator("sequencer.gap_remove").all = False
370 layout.operator("sequencer.gap_insert")
372 # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
375 layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
376 layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
377 layout.operator("sequencer.slip", text="Slip Strip Contents")
378 layout.operator("sequencer.images_separate")
379 layout.operator("sequencer.offset_clear")
380 layout.operator("sequencer.deinterlace_selected_movies")
381 layout.operator("sequencer.rebuild_proxy")
384 layout.operator("sequencer.duplicate_move")
385 layout.operator("sequencer.delete")
387 strip = act_strip(context)
392 # XXX note strip.type is never equal to 'EFFECT', look at seq_type_items within rna_sequencer.c
393 if stype == 'EFFECT':
396 # layout.operator("sequencer.effect_change")
397 # layout.operator("sequencer.effect_reassign_inputs")
398 elif stype == 'IMAGE':
400 # layout.operator("sequencer.image_change")
401 layout.operator("sequencer.rendersize")
402 elif stype == 'SCENE':
405 # layout.operator("sequencer.scene_change", text="Change Scene")
406 elif stype == 'MOVIE':
408 # layout.operator("sequencer.movie_change")
409 layout.operator("sequencer.rendersize")
410 elif stype == 'SOUND':
412 layout.operator("sequencer.crossfade_sounds")
416 layout.operator("sequencer.meta_make")
417 layout.operator("sequencer.meta_separate")
419 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
421 # uiItemO(layout, NULL, 0, "sequencer.meta_toggle");
425 layout.operator("sequencer.reload", text="Reload Strips")
426 layout.operator("sequencer.reload", text="Reload Strips and Adjust Length").adjust_length = True
427 layout.operator("sequencer.reassign_inputs")
428 layout.operator("sequencer.swap_inputs")
431 layout.operator("sequencer.lock")
432 layout.operator("sequencer.unlock")
433 layout.operator("sequencer.mute").unselected = False
434 layout.operator("sequencer.unmute").unselected = False
436 layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
438 layout.operator("sequencer.snap")
440 layout.operator_menu_enum("sequencer.swap", "side")
444 layout.operator("sequencer.swap_data")
445 layout.menu("SEQUENCER_MT_change")
448 class SequencerButtonsPanel:
449 bl_space_type = 'SEQUENCE_EDITOR'
450 bl_region_type = 'UI'
453 def has_sequencer(context):
454 return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
457 def poll(cls, context):
458 return cls.has_sequencer(context) and (act_strip(context) is not None)
461 class SequencerButtonsPanel_Output:
462 bl_space_type = 'SEQUENCE_EDITOR'
463 bl_region_type = 'UI'
466 def has_preview(context):
467 st = context.space_data
468 return (st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}) or st.show_backdrop
471 def poll(cls, context):
472 return cls.has_preview(context)
475 class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
476 bl_label = "Edit Strip"
478 def draw(self, context):
481 scene = context.scene
482 frame_current = scene.frame_current
483 strip = act_strip(context)
485 split = layout.split(percentage=0.3)
486 split.label(text="Name:")
487 split.prop(strip, "name", text="")
489 split = layout.split(percentage=0.3)
490 split.label(text="Type:")
491 split.prop(strip, "type", text="")
493 if strip.type != 'SOUND':
494 split = layout.split(percentage=0.3)
495 split.label(text="Blend:")
496 split.prop(strip, "blend_type", text="")
498 row = layout.row(align=True)
499 sub = row.row(align=True)
500 sub.active = (not strip.mute)
501 sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
502 row.prop(strip, "mute", toggle=True, icon_only=True)
503 row.prop(strip, "lock", toggle=True, icon_only=True)
505 row = layout.row(align=True)
506 row.prop(strip, "mute", toggle=True, icon_only=True)
507 row.prop(strip, "lock", toggle=True, icon_only=True)
509 col = layout.column()
511 sub.enabled = not strip.lock
512 sub.prop(strip, "channel")
513 sub.prop(strip, "frame_start")
514 sub.prop(strip, "frame_final_duration")
516 col = layout.column(align=True)
517 row = col.row(align=True)
518 row.label(text=iface_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
520 row = col.row(align=True)
521 row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
522 row.label(text=iface_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
524 col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
526 col.label(text=iface_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
530 if strip.type == 'IMAGE':
531 elem = strip.strip_elem_from_frame(frame_current)
532 elif strip.type == 'MOVIE':
533 elem = strip.elements[0]
535 if elem and elem.orig_width > 0 and elem.orig_height > 0:
536 col.label(text=iface_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
538 col.label(text="Original Dimension: None")
541 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
542 bl_label = "Effect Strip"
545 def poll(cls, context):
546 if not cls.has_sequencer(context):
549 strip = act_strip(context)
553 return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
554 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
555 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
556 'MULTICAM', 'GAUSSIAN_BLUR', 'TEXT'}
558 def draw(self, context):
561 strip = act_strip(context)
563 if strip.input_count > 0:
564 col = layout.column()
566 col.prop(strip, "input_1")
567 if strip.input_count > 1:
568 col.prop(strip, "input_2")
570 if strip.type == 'COLOR':
571 layout.prop(strip, "color")
573 elif strip.type == 'WIPE':
574 col = layout.column()
575 col.prop(strip, "transition_type")
576 col.label(text="Direction:")
577 col.row().prop(strip, "direction", expand=True)
579 col = layout.column()
580 col.prop(strip, "blur_width", slider=True)
581 if strip.transition_type in {'SINGLE', 'DOUBLE'}:
582 col.prop(strip, "angle")
584 elif strip.type == 'GLOW':
585 flow = layout.column_flow()
586 flow.prop(strip, "threshold", slider=True)
587 flow.prop(strip, "clamp", slider=True)
588 flow.prop(strip, "boost_factor")
589 flow.prop(strip, "blur_radius")
592 row.prop(strip, "quality", slider=True)
593 row.prop(strip, "use_only_boost")
595 elif strip.type == 'SPEED':
596 layout.prop(strip, "use_default_fade", "Stretch to input strip length")
597 if not strip.use_default_fade:
598 layout.prop(strip, "use_as_speed")
599 if strip.use_as_speed:
600 layout.prop(strip, "speed_factor")
602 layout.prop(strip, "speed_factor", text="Frame number")
603 layout.prop(strip, "scale_to_length")
605 elif strip.type == 'TRANSFORM':
607 col = layout.column()
609 col.prop(strip, "interpolation")
610 col.prop(strip, "translation_unit")
611 col = layout.column(align=True)
612 col.label(text="Position:")
613 col.prop(strip, "translate_start_x", text="X")
614 col.prop(strip, "translate_start_y", text="Y")
618 col = layout.column(align=True)
619 col.prop(strip, "use_uniform_scale")
620 if strip.use_uniform_scale:
621 col = layout.column(align=True)
622 col.prop(strip, "scale_start_x", text="Scale")
624 col = layout.column(align=True)
625 col.label(text="Scale:")
626 col.prop(strip, "scale_start_x", text="X")
627 col.prop(strip, "scale_start_y", text="Y")
631 col = layout.column(align=True)
632 col.label(text="Rotation:")
633 col.prop(strip, "rotation_start", text="Rotation")
635 elif strip.type == 'MULTICAM':
636 layout.prop(strip, "multicam_source")
638 row = layout.row(align=True)
639 sub = row.row(align=True)
642 sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY')
645 for i in range(1, strip.channel):
646 row.operator("sequencer.cut_multicam", text="%d" % i).camera = i
648 elif strip.type == 'TEXT':
649 col = layout.column()
650 col.prop(strip, "text")
651 col.prop(strip, "font_size")
652 col.prop(strip, "use_shadow")
653 col.prop(strip, "align_x")
654 col.prop(strip, "align_y")
655 col.prop(strip, "location")
656 col.prop(strip, "wrap_width")
657 layout.operator("sequencer.export_subtitles")
659 col = layout.column(align=True)
660 if strip.type == 'SPEED':
661 col.prop(strip, "multiply_speed")
662 elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}:
663 col.prop(strip, "use_default_fade", "Default fade")
664 if not strip.use_default_fade:
665 col.prop(strip, "effect_fader", text="Effect fader")
666 elif strip.type == 'GAUSSIAN_BLUR':
667 col.prop(strip, "size_x")
668 col.prop(strip, "size_y")
671 class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
672 bl_label = "Strip Input"
675 def poll(cls, context):
676 if not cls.has_sequencer(context):
679 strip = act_strip(context)
683 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'META',
684 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
685 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
686 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
687 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
689 def draw(self, context):
691 scene = context.scene
693 strip = act_strip(context)
695 seq_type = strip.type
697 # draw a filename if we have one
698 if seq_type == 'IMAGE':
699 split = layout.split(percentage=0.2)
700 split.label(text="Path:")
701 split.prop(strip, "directory", text="")
703 # Current element for the filename
705 elem = strip.strip_elem_from_frame(scene.frame_current)
707 split = layout.split(percentage=0.2)
708 split.label(text="File:")
709 split.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
711 layout.prop(strip.colorspace_settings, "name")
712 layout.prop(strip, "alpha_mode")
714 layout.operator("sequencer.change_path")
716 elif seq_type == 'MOVIE':
717 split = layout.split(percentage=0.2)
718 split.label(text="Path:")
719 split.prop(strip, "filepath", text="")
721 layout.prop(strip.colorspace_settings, "name")
723 layout.prop(strip, "mpeg_preseek")
724 layout.prop(strip, "stream_index")
726 layout.prop(strip, "use_translation", text="Image Offset")
727 if strip.use_translation:
728 col = layout.column(align=True)
729 col.prop(strip.transform, "offset_x", text="X")
730 col.prop(strip.transform, "offset_y", text="Y")
732 layout.prop(strip, "use_crop", text="Image Crop")
734 col = layout.column(align=True)
735 col.prop(strip.crop, "max_y")
736 col.prop(strip.crop, "min_x")
737 col.prop(strip.crop, "min_y")
738 col.prop(strip.crop, "max_x")
740 if not isinstance(strip, bpy.types.EffectSequence):
741 col = layout.column(align=True)
742 col.label(text="Trim Duration (hard):")
743 col.prop(strip, "animation_offset_start", text="Start")
744 col.prop(strip, "animation_offset_end", text="End")
746 col = layout.column(align=True)
747 col.label(text="Trim Duration (soft):")
748 col.prop(strip, "frame_offset_start", text="Start")
749 col.prop(strip, "frame_offset_end", text="End")
751 if scene.render.use_multiview and seq_type in {'IMAGE', 'MOVIE'}:
752 layout.prop(strip, "use_multiview")
754 col = layout.column()
755 col.active = strip.use_multiview
757 col.label(text="Views Format:")
758 col.row().prop(strip, "views_format", expand=True)
761 box.active = strip.views_format == 'STEREO_3D'
762 box.template_image_stereo_3d(strip.stereo_3d_format)
765 class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
769 def poll(cls, context):
770 if not cls.has_sequencer(context):
773 strip = act_strip(context)
777 return (strip.type == 'SOUND')
779 def draw(self, context):
782 st = context.space_data
783 strip = act_strip(context)
786 layout.template_ID(strip, "sound", open="sound.open")
787 if sound is not None:
788 layout.prop(sound, "filepath", text="")
791 if sound.packed_file:
792 row.operator("sound.unpack", icon='PACKAGE', text="Unpack")
794 row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack")
796 row.prop(sound, "use_memory_cache")
798 layout.prop(sound, "use_mono")
800 if st.waveform_draw_type == 'DEFAULT_WAVEFORMS':
801 layout.prop(strip, "show_waveform")
803 layout.prop(strip, "volume")
804 layout.prop(strip, "pitch")
805 layout.prop(strip, "pan")
807 col = layout.column(align=True)
808 col.label(text="Trim Duration (hard):")
809 col.prop(strip, "animation_offset_start", text="Start")
810 col.prop(strip, "animation_offset_end", text="End")
812 col = layout.column(align=True)
813 col.label(text="Trim Duration (soft):")
814 col.prop(strip, "frame_offset_start", text="Start")
815 col.prop(strip, "frame_offset_end", text="End")
818 class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
822 def poll(cls, context):
823 if not cls.has_sequencer(context):
826 strip = act_strip(context)
830 return (strip.type == 'SCENE')
832 def draw(self, context):
835 strip = act_strip(context)
837 layout.template_ID(strip, "scene")
840 layout.prop(strip, "use_sequence")
842 if not strip.use_sequence:
843 layout.label(text="Camera Override")
844 layout.template_ID(strip, "scene_camera")
846 layout.prop(strip, "use_grease_pencil", text="Show Grease Pencil")
849 layout.prop(scene, "audio_volume", text="Audio Volume")
851 sta = scene.frame_start
852 end = scene.frame_end
853 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
856 class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
860 def poll(cls, context):
861 if not cls.has_sequencer(context):
864 strip = act_strip(context)
868 return (strip.type == 'MASK')
870 def draw(self, context):
873 strip = act_strip(context)
875 layout.template_ID(strip, "mask")
880 sta = mask.frame_start
882 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
885 class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
889 def poll(cls, context):
890 if not cls.has_sequencer(context):
893 strip = act_strip(context)
897 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'MASK',
898 'META', 'ADD', 'SUBTRACT', 'ALPHA_OVER',
899 'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY',
900 'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
901 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
903 def draw(self, context):
906 strip = act_strip(context)
908 col = layout.column()
909 col.label(text="Video:")
910 col.prop(strip, "strobe")
912 if strip.type == 'MOVIECLIP':
913 col = layout.column()
914 col.label(text="Tracker:")
915 col.prop(strip, "stabilize2d")
917 col = layout.column()
918 col.label(text="Distortion:")
919 col.prop(strip, "undistort")
921 split = layout.split(percentage=0.65)
924 col.prop(strip, "use_reverse_frames", text="Backwards")
925 col.prop(strip, "use_deinterlace")
928 col.label(text="Flip:")
929 col.prop(strip, "use_flip_x", text="X")
930 col.prop(strip, "use_flip_y", text="Y")
932 col = layout.column()
933 col.label(text="Colors:")
934 col.prop(strip, "color_saturation", text="Saturation")
935 col.prop(strip, "color_multiply", text="Multiply")
936 col.prop(strip, "use_float")
939 class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
940 bl_label = "Proxy / Timecode"
943 def poll(cls, context):
944 if not cls.has_sequencer(context):
947 strip = act_strip(context)
951 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'META', 'MULTICAM'}
953 def draw_header(self, context):
954 strip = act_strip(context)
956 self.layout.prop(strip, "use_proxy", text="")
958 def draw(self, context):
961 sequencer = context.scene.sequence_editor
963 strip = act_strip(context)
968 flow = layout.column_flow()
969 flow.prop(sequencer, "proxy_storage")
970 if sequencer.proxy_storage == 'PROJECT':
971 flow.prop(sequencer, "proxy_dir")
973 flow.prop(proxy, "use_proxy_custom_directory")
974 flow.prop(proxy, "use_proxy_custom_file")
976 if proxy.use_proxy_custom_directory and not proxy.use_proxy_custom_file:
977 flow.prop(proxy, "directory")
978 if proxy.use_proxy_custom_file:
979 flow.prop(proxy, "filepath")
981 row = layout.row(align=True)
982 row.prop(strip.proxy, "build_25", toggle=True)
983 row.prop(strip.proxy, "build_50", toggle=True)
984 row.prop(strip.proxy, "build_75", toggle=True)
985 row.prop(strip.proxy, "build_100", toggle=True)
987 layout.prop(proxy, "use_overwrite")
989 col = layout.column()
990 col.label(text="Build JPEG quality")
991 col.prop(proxy, "quality")
993 if strip.type == 'MOVIE':
994 col = layout.column()
995 col.label(text="Use timecode index:")
997 col.prop(proxy, "timecode")
999 col = layout.column()
1000 col.operator("sequencer.enable_proxies")
1001 col.operator("sequencer.rebuild_proxy")
1004 class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
1005 bl_label = "Scene Preview/Render"
1006 bl_space_type = 'SEQUENCE_EDITOR'
1007 bl_region_type = 'UI'
1009 def draw(self, context):
1010 layout = self.layout
1012 render = context.scene.render
1014 col = layout.column()
1015 col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
1016 col = layout.column()
1017 #col.active = render.use_sequencer_gl_preview
1018 col.prop(render, "sequencer_gl_preview", text="")
1021 row.active = render.sequencer_gl_preview == 'SOLID'
1022 row.prop(render, "use_sequencer_gl_textured_solid")
1025 class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
1026 bl_label = "View Settings"
1028 def draw(self, context):
1029 layout = self.layout
1031 st = context.space_data
1033 col = layout.column()
1034 if st.display_mode == 'IMAGE':
1035 col.prop(st, "draw_overexposed")
1038 elif st.display_mode == 'WAVEFORM':
1039 col.prop(st, "show_separate_color")
1041 col = layout.column()
1043 col.prop(st, "proxy_render_size")
1046 class SEQUENCER_PT_view_safe_areas(SequencerButtonsPanel_Output, Panel):
1047 bl_label = "Safe Areas"
1048 bl_options = {'DEFAULT_CLOSED'}
1051 def poll(cls, context):
1052 st = context.space_data
1053 is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
1054 return is_preview and (st.display_mode == 'IMAGE')
1056 def draw_header(self, context):
1057 st = context.space_data
1059 self.layout.prop(st, "show_safe_areas", text="")
1061 def draw(self, context):
1062 from bl_ui.properties_data_camera import draw_display_safe_settings
1064 layout = self.layout
1065 st = context.space_data
1066 safe_data = context.scene.safe_areas
1068 draw_display_safe_settings(layout, safe_data, st)
1071 class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
1072 bl_label = "Modifiers"
1074 def draw(self, context):
1075 layout = self.layout
1077 strip = act_strip(context)
1078 sequencer = context.scene.sequence_editor
1080 layout.prop(strip, "use_linear_modifiers")
1082 layout.operator_menu_enum("sequencer.strip_modifier_add", "type")
1083 layout.operator("sequencer.strip_modifier_copy")
1085 for mod in strip.modifiers:
1089 row.prop(mod, "show_expanded", text="", emboss=False)
1090 row.prop(mod, "name", text="")
1092 row.prop(mod, "mute", text="")
1094 sub = row.row(align=True)
1095 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_UP')
1096 props.name = mod.name
1097 props.direction = 'UP'
1098 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_DOWN')
1099 props.name = mod.name
1100 props.direction = 'DOWN'
1102 row.operator("sequencer.strip_modifier_remove", text="", icon='X', emboss=False).name = mod.name
1104 if mod.show_expanded:
1106 row.prop(mod, "input_mask_type", expand=True)
1108 if mod.input_mask_type == 'STRIP':
1109 sequences_object = sequencer
1110 if sequencer.meta_stack:
1111 sequences_object = sequencer.meta_stack[-1]
1112 box.prop_search(mod, "input_mask_strip", sequences_object, "sequences", text="Mask")
1114 box.prop(mod, "input_mask_id")
1116 row.prop(mod, "mask_time", expand=True)
1118 if mod.type == 'COLOR_BALANCE':
1119 box.prop(mod, "color_multiply")
1120 draw_color_balance(box, mod.color_balance)
1121 elif mod.type == 'CURVES':
1122 box.template_curve_mapping(mod, "curve_mapping", type='COLOR')
1123 elif mod.type == 'HUE_CORRECT':
1124 box.template_curve_mapping(mod, "curve_mapping", type='HUE')
1125 elif mod.type == 'BRIGHT_CONTRAST':
1127 col.prop(mod, "bright")
1128 col.prop(mod, "contrast")
1129 elif mod.type == 'WHITE_BALANCE':
1131 col.prop(mod, "white_value")
1132 elif mod.type == 'TONEMAP':
1134 col.prop(mod, "tonemap_type")
1135 if mod.tonemap_type == 'RD_PHOTORECEPTOR':
1136 col.prop(mod, "intensity")
1137 col.prop(mod, "contrast")
1138 col.prop(mod, "adaptation")
1139 col.prop(mod, "correction")
1140 elif mod.tonemap_type == 'RH_SIMPLE':
1141 col.prop(mod, "key")
1142 col.prop(mod, "offset")
1143 col.prop(mod, "gamma")
1145 class SEQUENCER_PT_grease_pencil(GreasePencilDataPanel, SequencerButtonsPanel_Output, Panel):
1146 bl_space_type = 'SEQUENCE_EDITOR'
1147 bl_region_type = 'UI'
1149 # NOTE: this is just a wrapper around the generic GP Panel
1150 # But, it should only show up when there are images in the preview region
1153 class SEQUENCER_PT_grease_pencil_tools(GreasePencilToolsPanel, SequencerButtonsPanel_Output, Panel):
1154 bl_space_type = 'SEQUENCE_EDITOR'
1155 bl_region_type = 'UI'
1157 # NOTE: this is just a wrapper around the generic GP tools panel
1158 # It contains access to some essential tools usually found only in
1159 # toolbar, which doesn't exist here...
1162 class SEQUENCER_PT_custom_props(SequencerButtonsPanel, PropertyPanel, Panel):
1163 COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
1164 _context_path = "scene.sequence_editor.active_strip"
1165 _property_type = (bpy.types.Sequence,)
1168 if __name__ == "__main__": # only for live edit.
1169 bpy.utils.register_module(__name__)