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 layout.prop(st, "show_metadata")
211 elif st.display_mode == 'WAVEFORM':
212 layout.prop(st, "show_separate_color")
216 if is_sequencer_view:
217 layout.prop(st, "use_marker_sync")
220 layout.operator("screen.area_dupli")
221 layout.operator("screen.screen_full_area", text="Toggle Maximize Area")
222 layout.operator("screen.screen_full_area").use_hide_panels = True
225 class SEQUENCER_MT_select(Menu):
228 def draw(self, context):
231 layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
232 layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
233 props = layout.operator("sequencer.select", text="All strips to the Left")
234 props.left_right = 'LEFT'
235 props.linked_time = True
236 props = layout.operator("sequencer.select", text="All strips to the Right")
237 props.left_right = 'RIGHT'
238 props.linked_time = True
241 layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
242 layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
243 layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT'
245 layout.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
246 layout.operator("sequencer.select_linked")
247 layout.operator("sequencer.select_all").action = 'TOGGLE'
248 layout.operator("sequencer.select_all", text="Inverse").action = 'INVERT'
251 class SEQUENCER_MT_marker(Menu):
254 def draw(self, context):
257 from bl_ui.space_time import marker_menu_generic
258 marker_menu_generic(layout)
261 class SEQUENCER_MT_change(Menu):
264 def draw(self, context):
267 layout.operator_context = 'INVOKE_REGION_WIN'
269 layout.operator_menu_enum("sequencer.change_effect_input", "swap")
270 layout.operator_menu_enum("sequencer.change_effect_type", "type")
271 layout.operator("sequencer.change_path", text="Path/Files")
274 class SEQUENCER_MT_frame(Menu):
277 def draw(self, context):
280 layout.operator("anim.previewrange_clear")
281 layout.operator("anim.previewrange_set")
284 class SEQUENCER_MT_add(Menu):
287 def draw(self, context):
290 layout.operator_context = 'INVOKE_REGION_WIN'
292 if len(bpy.data.scenes) > 10:
293 layout.operator_context = 'INVOKE_DEFAULT'
294 layout.operator("sequencer.scene_strip_add", text="Scene...")
296 layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...")
298 if len(bpy.data.movieclips) > 10:
299 layout.operator_context = 'INVOKE_DEFAULT'
300 layout.operator("sequencer.movieclip_strip_add", text="Clips...")
302 layout.operator_menu_enum("sequencer.movieclip_strip_add", "clip", text="Clip...")
304 if len(bpy.data.masks) > 10:
305 layout.operator_context = 'INVOKE_DEFAULT'
306 layout.operator("sequencer.mask_strip_add", text="Masks...")
308 layout.operator_menu_enum("sequencer.mask_strip_add", "mask", text="Mask...")
310 layout.operator("sequencer.movie_strip_add", text="Movie")
311 layout.operator("sequencer.image_strip_add", text="Image")
312 layout.operator("sequencer.sound_strip_add", text="Sound")
314 layout.menu("SEQUENCER_MT_add_effect")
317 class SEQUENCER_MT_add_effect(Menu):
318 bl_label = "Effect Strip..."
320 def draw(self, context):
323 layout.operator_context = 'INVOKE_REGION_WIN'
325 layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
326 layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT'
327 layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
328 layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
329 layout.operator("sequencer.effect_strip_add", text="Cross").type = 'CROSS'
330 layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS'
331 layout.operator("sequencer.effect_strip_add", text="Gaussian Blur").type = 'GAUSSIAN_BLUR'
332 layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY'
333 layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP'
334 layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE'
335 layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW'
336 layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM'
337 layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
338 layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
339 layout.operator("sequencer.effect_strip_add", text="Multicam Selector").type = 'MULTICAM'
340 layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
343 class SEQUENCER_MT_strip(Menu):
346 def draw(self, context):
349 layout.operator_context = 'INVOKE_REGION_WIN'
351 layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
352 layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
353 layout.operator("sequencer.gap_remove").all = False
354 layout.operator("sequencer.gap_insert")
356 # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
359 layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
360 layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
361 layout.operator("sequencer.slip", text="Slip Strip Contents")
362 layout.operator("sequencer.images_separate")
363 layout.operator("sequencer.offset_clear")
364 layout.operator("sequencer.deinterlace_selected_movies")
365 layout.operator("sequencer.rebuild_proxy")
368 layout.operator("sequencer.duplicate_move")
369 layout.operator("sequencer.delete")
371 strip = act_strip(context)
376 # XXX note strip.type is never equal to 'EFFECT', look at seq_type_items within rna_sequencer.c
377 if stype == 'EFFECT':
380 # layout.operator("sequencer.effect_change")
381 # layout.operator("sequencer.effect_reassign_inputs")
382 elif stype == 'IMAGE':
384 # layout.operator("sequencer.image_change")
385 layout.operator("sequencer.rendersize")
386 elif stype == 'SCENE':
389 # layout.operator("sequencer.scene_change", text="Change Scene")
390 elif stype == 'MOVIE':
392 # layout.operator("sequencer.movie_change")
393 layout.operator("sequencer.rendersize")
394 elif stype == 'SOUND':
396 layout.operator("sequencer.crossfade_sounds")
400 layout.operator("sequencer.meta_make")
401 layout.operator("sequencer.meta_separate")
403 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
405 # uiItemO(layout, NULL, 0, "sequencer.meta_toggle");
409 layout.operator("sequencer.reload", text="Reload Strips")
410 layout.operator("sequencer.reload", text="Reload Strips and Adjust Length").adjust_length = True
411 layout.operator("sequencer.reassign_inputs")
412 layout.operator("sequencer.swap_inputs")
415 layout.operator("sequencer.lock")
416 layout.operator("sequencer.unlock")
417 layout.operator("sequencer.mute").unselected = False
418 layout.operator("sequencer.unmute").unselected = False
420 layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
422 layout.operator("sequencer.snap")
424 layout.operator_menu_enum("sequencer.swap", "side")
428 layout.operator("sequencer.swap_data")
429 layout.menu("SEQUENCER_MT_change")
432 class SequencerButtonsPanel:
433 bl_space_type = 'SEQUENCE_EDITOR'
434 bl_region_type = 'UI'
437 def has_sequencer(context):
438 return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
441 def poll(cls, context):
442 return cls.has_sequencer(context) and (act_strip(context) is not None)
445 class SequencerButtonsPanel_Output:
446 bl_space_type = 'SEQUENCE_EDITOR'
447 bl_region_type = 'UI'
450 def has_preview(context):
451 st = context.space_data
452 return (st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}) or st.show_backdrop
455 def poll(cls, context):
456 return cls.has_preview(context)
459 class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
460 bl_label = "Edit Strip"
462 def draw(self, context):
465 scene = context.scene
466 frame_current = scene.frame_current
467 strip = act_strip(context)
469 split = layout.split(percentage=0.3)
470 split.label(text="Name:")
471 split.prop(strip, "name", text="")
473 split = layout.split(percentage=0.3)
474 split.label(text="Type:")
475 split.prop(strip, "type", text="")
477 if strip.type != 'SOUND':
478 split = layout.split(percentage=0.3)
479 split.label(text="Blend:")
480 split.prop(strip, "blend_type", text="")
482 row = layout.row(align=True)
483 sub = row.row(align=True)
484 sub.active = (not strip.mute)
485 sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
486 row.prop(strip, "mute", toggle=True, icon_only=True)
487 row.prop(strip, "lock", toggle=True, icon_only=True)
489 row = layout.row(align=True)
490 row.prop(strip, "mute", toggle=True, icon_only=True)
491 row.prop(strip, "lock", toggle=True, icon_only=True)
493 col = layout.column()
495 sub.enabled = not strip.lock
496 sub.prop(strip, "channel")
497 sub.prop(strip, "frame_start")
498 sub.prop(strip, "frame_final_duration")
500 col = layout.column(align=True)
501 row = col.row(align=True)
502 row.label(text=iface_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
504 row = col.row(align=True)
505 row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
506 row.label(text=iface_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
508 col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
510 col.label(text=iface_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
514 if strip.type == 'IMAGE':
515 elem = strip.strip_elem_from_frame(frame_current)
516 elif strip.type == 'MOVIE':
517 elem = strip.elements[0]
519 if elem and elem.orig_width > 0 and elem.orig_height > 0:
520 col.label(text=iface_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
522 col.label(text="Original Dimension: None")
525 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
526 bl_label = "Effect Strip"
529 def poll(cls, context):
530 if not cls.has_sequencer(context):
533 strip = act_strip(context)
537 return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
538 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
539 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
540 'MULTICAM', 'GAUSSIAN_BLUR'}
542 def draw(self, context):
545 strip = act_strip(context)
547 if strip.input_count > 0:
548 col = layout.column()
549 col.prop(strip, "input_1")
550 if strip.input_count > 1:
551 col.prop(strip, "input_2")
553 if strip.type == 'COLOR':
554 layout.prop(strip, "color")
556 elif strip.type == 'WIPE':
557 col = layout.column()
558 col.prop(strip, "transition_type")
559 col.label(text="Direction:")
560 col.row().prop(strip, "direction", expand=True)
562 col = layout.column()
563 col.prop(strip, "blur_width", slider=True)
564 if strip.transition_type in {'SINGLE', 'DOUBLE'}:
565 col.prop(strip, "angle")
567 elif strip.type == 'GLOW':
568 flow = layout.column_flow()
569 flow.prop(strip, "threshold", slider=True)
570 flow.prop(strip, "clamp", slider=True)
571 flow.prop(strip, "boost_factor")
572 flow.prop(strip, "blur_radius")
575 row.prop(strip, "quality", slider=True)
576 row.prop(strip, "use_only_boost")
578 elif strip.type == 'SPEED':
579 layout.prop(strip, "use_default_fade", "Stretch to input strip length")
580 if not strip.use_default_fade:
581 layout.prop(strip, "use_as_speed")
582 if strip.use_as_speed:
583 layout.prop(strip, "speed_factor")
585 layout.prop(strip, "speed_factor", text="Frame number")
586 layout.prop(strip, "scale_to_length")
588 elif strip.type == 'TRANSFORM':
590 col = layout.column()
592 col.prop(strip, "interpolation")
593 col.prop(strip, "translation_unit")
594 col = layout.column(align=True)
595 col.label(text="Position:")
596 col.prop(strip, "translate_start_x", text="X")
597 col.prop(strip, "translate_start_y", text="Y")
601 col = layout.column(align=True)
602 col.prop(strip, "use_uniform_scale")
603 if strip.use_uniform_scale:
604 col = layout.column(align=True)
605 col.prop(strip, "scale_start_x", text="Scale")
607 col = layout.column(align=True)
608 col.label(text="Scale:")
609 col.prop(strip, "scale_start_x", text="X")
610 col.prop(strip, "scale_start_y", text="Y")
614 col = layout.column(align=True)
615 col.label(text="Rotation:")
616 col.prop(strip, "rotation_start", text="Rotation")
618 elif strip.type == 'MULTICAM':
619 layout.prop(strip, "multicam_source")
621 row = layout.row(align=True)
622 sub = row.row(align=True)
625 sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY')
628 for i in range(1, strip.channel):
629 row.operator("sequencer.cut_multicam", text="%d" % i).camera = i
631 col = layout.column(align=True)
632 if strip.type == 'SPEED':
633 col.prop(strip, "multiply_speed")
634 elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}:
635 col.prop(strip, "use_default_fade", "Default fade")
636 if not strip.use_default_fade:
637 col.prop(strip, "effect_fader", text="Effect fader")
638 elif strip.type == 'GAUSSIAN_BLUR':
639 col.prop(strip, "size_x")
640 col.prop(strip, "size_y")
643 class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
644 bl_label = "Strip Input"
647 def poll(cls, context):
648 if not cls.has_sequencer(context):
651 strip = act_strip(context)
655 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'META',
656 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
657 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
658 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
659 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
661 def draw(self, context):
663 scene = context.scene
665 strip = act_strip(context)
667 seq_type = strip.type
669 # draw a filename if we have one
670 if seq_type == 'IMAGE':
671 split = layout.split(percentage=0.2)
672 split.label(text="Path:")
673 split.prop(strip, "directory", text="")
675 # Current element for the filename
677 elem = strip.strip_elem_from_frame(scene.frame_current)
679 split = layout.split(percentage=0.2)
680 split.label(text="File:")
681 split.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
683 layout.prop(strip.colorspace_settings, "name")
684 layout.prop(strip, "alpha_mode")
686 layout.operator("sequencer.change_path")
688 elif seq_type == 'MOVIE':
689 split = layout.split(percentage=0.2)
690 split.label(text="Path:")
691 split.prop(strip, "filepath", text="")
693 layout.prop(strip.colorspace_settings, "name")
695 layout.prop(strip, "mpeg_preseek")
696 layout.prop(strip, "stream_index")
698 layout.prop(strip, "use_translation", text="Image Offset")
699 if strip.use_translation:
700 col = layout.column(align=True)
701 col.prop(strip.transform, "offset_x", text="X")
702 col.prop(strip.transform, "offset_y", text="Y")
704 layout.prop(strip, "use_crop", text="Image Crop")
706 col = layout.column(align=True)
707 col.prop(strip.crop, "max_y")
708 col.prop(strip.crop, "min_x")
709 col.prop(strip.crop, "min_y")
710 col.prop(strip.crop, "max_x")
712 if not isinstance(strip, bpy.types.EffectSequence):
713 col = layout.column(align=True)
714 col.label(text="Trim Duration (hard):")
715 col.prop(strip, "animation_offset_start", text="Start")
716 col.prop(strip, "animation_offset_end", text="End")
718 col = layout.column(align=True)
719 col.label(text="Trim Duration (soft):")
720 col.prop(strip, "frame_offset_start", text="Start")
721 col.prop(strip, "frame_offset_end", text="End")
723 if scene.render.use_multiview and seq_type in {'IMAGE', 'MOVIE'}:
724 layout.prop(strip, "use_multiview")
726 col = layout.column()
727 col.active = strip.use_multiview
729 col.label(text="Views Format:")
730 col.row().prop(strip, "views_format", expand=True)
733 box.active = strip.views_format == 'STEREO_3D'
734 box.template_image_stereo_3d(strip.stereo_3d_format)
737 class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
741 def poll(cls, context):
742 if not cls.has_sequencer(context):
745 strip = act_strip(context)
749 return (strip.type == 'SOUND')
751 def draw(self, context):
754 st = context.space_data
755 strip = act_strip(context)
758 # TODO: add support to handle SOUND datablock in sequencer soundstrips... For now, hide this useless thing!
759 # layout.template_ID(strip, "sound", open="sound.open")
762 layout.prop(strip, "filepath", text="")
764 if sound is not None:
766 if sound.packed_file:
767 row.operator("sound.unpack", icon='PACKAGE', text="Unpack")
769 row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack")
771 row.prop(sound, "use_memory_cache")
773 if st.waveform_draw_type == 'DEFAULT_WAVEFORMS':
774 layout.prop(strip, "show_waveform")
776 layout.prop(strip, "volume")
777 layout.prop(strip, "pitch")
778 layout.prop(strip, "pan")
780 col = layout.column(align=True)
781 col.label(text="Trim Duration (hard):")
782 col.prop(strip, "animation_offset_start", text="Start")
783 col.prop(strip, "animation_offset_end", text="End")
785 col = layout.column(align=True)
786 col.label(text="Trim Duration (soft):")
787 col.prop(strip, "frame_offset_start", text="Start")
788 col.prop(strip, "frame_offset_end", text="End")
791 class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
795 def poll(cls, context):
796 if not cls.has_sequencer(context):
799 strip = act_strip(context)
803 return (strip.type == 'SCENE')
805 def draw(self, context):
808 strip = act_strip(context)
810 layout.template_ID(strip, "scene")
814 layout.label(text="Camera Override")
815 layout.template_ID(strip, "scene_camera")
817 layout.prop(strip, "use_grease_pencil", text="Show Grease Pencil")
820 layout.prop(scene, "audio_volume", text="Audio Volume")
822 sta = scene.frame_start
823 end = scene.frame_end
824 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
827 class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
831 def poll(cls, context):
832 if not cls.has_sequencer(context):
835 strip = act_strip(context)
839 return (strip.type == 'MASK')
841 def draw(self, context):
844 strip = act_strip(context)
846 layout.template_ID(strip, "mask")
851 sta = mask.frame_start
853 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
856 class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
860 def poll(cls, context):
861 if not cls.has_sequencer(context):
864 strip = act_strip(context)
868 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'MASK',
869 'META', 'ADD', 'SUBTRACT', 'ALPHA_OVER',
870 'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY',
871 'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
872 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
874 def draw(self, context):
877 strip = act_strip(context)
879 col = layout.column()
880 col.label(text="Video:")
881 col.prop(strip, "strobe")
883 if strip.type == 'MOVIECLIP':
884 col = layout.column()
885 col.label(text="Tracker:")
886 col.prop(strip, "stabilize2d")
888 col = layout.column()
889 col.label(text="Distortion:")
890 col.prop(strip, "undistort")
892 split = layout.split(percentage=0.65)
895 col.prop(strip, "use_reverse_frames", text="Backwards")
896 col.prop(strip, "use_deinterlace")
899 col.label(text="Flip:")
900 col.prop(strip, "use_flip_x", text="X")
901 col.prop(strip, "use_flip_y", text="Y")
903 col = layout.column()
904 col.label(text="Colors:")
905 col.prop(strip, "color_saturation", text="Saturation")
906 col.prop(strip, "color_multiply", text="Multiply")
907 col.prop(strip, "use_float")
910 class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
911 bl_label = "Proxy / Timecode"
914 def poll(cls, context):
915 if not cls.has_sequencer(context):
918 strip = act_strip(context)
922 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'META', 'MULTICAM'}
924 def draw_header(self, context):
925 strip = act_strip(context)
927 self.layout.prop(strip, "use_proxy", text="")
929 def draw(self, context):
932 sequencer = context.scene.sequence_editor
934 strip = act_strip(context)
939 flow = layout.column_flow()
940 flow.prop(sequencer, "proxy_storage")
941 if sequencer.proxy_storage == 'PROJECT':
942 flow.prop(sequencer, "proxy_dir")
944 flow.prop(proxy, "use_proxy_custom_directory")
945 flow.prop(proxy, "use_proxy_custom_file")
947 if proxy.use_proxy_custom_directory and not proxy.use_proxy_custom_file:
948 flow.prop(proxy, "directory")
949 if proxy.use_proxy_custom_file:
950 flow.prop(proxy, "filepath")
953 row.prop(strip.proxy, "build_25")
954 row.prop(strip.proxy, "build_50")
955 row.prop(strip.proxy, "build_75")
956 row.prop(strip.proxy, "build_100")
958 layout.prop(proxy, "use_overwrite")
960 col = layout.column()
961 col.label(text="Build JPEG quality")
962 col.prop(proxy, "quality")
964 if strip.type == 'MOVIE':
965 col = layout.column()
966 col.label(text="Use timecode index:")
968 col.prop(proxy, "timecode")
970 col = layout.column()
971 col.operator("sequencer.enable_proxies")
972 col.operator("sequencer.rebuild_proxy")
975 class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
976 bl_label = "Scene Preview/Render"
977 bl_space_type = 'SEQUENCE_EDITOR'
978 bl_region_type = 'UI'
980 def draw(self, context):
983 render = context.scene.render
985 col = layout.column()
986 col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
987 col = layout.column()
988 #col.active = render.use_sequencer_gl_preview
989 col.prop(render, "sequencer_gl_preview", text="")
992 row.active = render.sequencer_gl_preview == 'SOLID'
993 row.prop(render, "use_sequencer_gl_textured_solid")
996 class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
997 bl_label = "View Settings"
999 def draw(self, context):
1000 layout = self.layout
1002 st = context.space_data
1004 col = layout.column()
1005 if st.display_mode == 'IMAGE':
1006 col.prop(st, "draw_overexposed")
1009 elif st.display_mode == 'WAVEFORM':
1010 col.prop(st, "show_separate_color")
1012 col = layout.column()
1014 col.prop(st, "proxy_render_size")
1017 class SEQUENCER_PT_view_safe_areas(SequencerButtonsPanel_Output, Panel):
1018 bl_label = "Safe Areas"
1019 bl_options = {'DEFAULT_CLOSED'}
1022 def poll(cls, context):
1023 st = context.space_data
1024 is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
1025 return is_preview and (st.display_mode == 'IMAGE')
1027 def draw_header(self, context):
1028 st = context.space_data
1030 self.layout.prop(st, "show_safe_areas", text="")
1032 def draw(self, context):
1033 from bl_ui.properties_data_camera import draw_display_safe_settings
1035 layout = self.layout
1036 st = context.space_data
1037 safe_data = context.scene.safe_areas
1039 draw_display_safe_settings(layout, safe_data, st)
1042 class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
1043 bl_label = "Modifiers"
1045 def draw(self, context):
1046 layout = self.layout
1048 strip = act_strip(context)
1049 sequencer = context.scene.sequence_editor
1051 layout.prop(strip, "use_linear_modifiers")
1053 layout.operator_menu_enum("sequencer.strip_modifier_add", "type")
1054 layout.operator("sequencer.strip_modifier_copy")
1056 for mod in strip.modifiers:
1060 row.prop(mod, "show_expanded", text="", emboss=False)
1061 row.prop(mod, "name", text="")
1063 row.prop(mod, "mute", text="")
1065 sub = row.row(align=True)
1066 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_UP')
1067 props.name = mod.name
1068 props.direction = 'UP'
1069 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_DOWN')
1070 props.name = mod.name
1071 props.direction = 'DOWN'
1073 row.operator("sequencer.strip_modifier_remove", text="", icon='X', emboss=False).name = mod.name
1075 if mod.show_expanded:
1077 row.prop(mod, "input_mask_type", expand=True)
1079 if mod.input_mask_type == 'STRIP':
1080 sequences_object = sequencer
1081 if sequencer.meta_stack:
1082 sequences_object = sequencer.meta_stack[-1]
1083 box.prop_search(mod, "input_mask_strip", sequences_object, "sequences", text="Mask")
1085 box.prop(mod, "input_mask_id")
1087 if mod.type == 'COLOR_BALANCE':
1088 box.prop(mod, "color_multiply")
1089 draw_color_balance(box, mod.color_balance)
1090 elif mod.type == 'CURVES':
1091 box.template_curve_mapping(mod, "curve_mapping", type='COLOR')
1092 elif mod.type == 'HUE_CORRECT':
1093 box.template_curve_mapping(mod, "curve_mapping", type='HUE')
1094 elif mod.type == 'BRIGHT_CONTRAST':
1096 col.prop(mod, "bright")
1097 col.prop(mod, "contrast")
1100 class SEQUENCER_PT_grease_pencil(GreasePencilDataPanel, SequencerButtonsPanel_Output, Panel):
1101 bl_space_type = 'SEQUENCE_EDITOR'
1102 bl_region_type = 'UI'
1104 # NOTE: this is just a wrapper around the generic GP Panel
1105 # But, it should only show up when there are images in the preview region
1108 class SEQUENCER_PT_grease_pencil_tools(GreasePencilToolsPanel, 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 tools panel
1113 # It contains access to some essential tools usually found only in
1114 # toolbar, which doesn't exist here...
1117 class SEQUENCER_PT_custom_props(SequencerButtonsPanel, PropertyPanel, Panel):
1118 COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
1119 _context_path = "scene.sequence_editor.active_strip"
1120 _property_type = (bpy.types.Sequence,)
1123 if __name__ == "__main__": # only for live edit.
1124 bpy.utils.register_module(__name__)