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 bpy.app.translations import pgettext_iface as iface_
25 def act_strip(context):
27 return context.scene.sequence_editor.active_strip
28 except AttributeError:
32 def draw_color_balance(layout, color_balance):
34 col.label(text="Lift:")
35 col.template_color_picker(color_balance, "lift", value_slider=True, cubic=True)
37 row.prop(color_balance, "lift", text="")
38 row.prop(color_balance, "invert_lift", text="Inverse")
41 col.label(text="Gamma:")
42 col.template_color_picker(color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True)
44 row.prop(color_balance, "gamma", text="")
45 row.prop(color_balance, "invert_gamma", text="Inverse")
48 col.label(text="Gain:")
49 col.template_color_picker(color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True)
51 row.prop(color_balance, "gain", text="")
52 row.prop(color_balance, "invert_gain", text="Inverse")
55 class SEQUENCER_HT_header(Header):
56 bl_space_type = 'SEQUENCE_EDITOR'
58 def draw(self, context):
61 st = context.space_data
63 row = layout.row(align=True)
66 SEQUENCER_MT_editor_menus.draw_collapsible(context, layout)
68 layout.prop(st, "view_type", expand=True, text="")
70 if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
71 layout.prop(st, "display_mode", expand=True, text="")
73 if st.view_type == 'SEQUENCER':
74 row = layout.row(align=True)
75 row.operator("sequencer.copy", text="", icon='COPYDOWN')
76 row.operator("sequencer.paste", text="", icon='PASTEDOWN')
79 layout.operator("sequencer.refresh_all")
81 if st.view_type == 'SEQUENCER_PREVIEW':
83 layout.operator("sequencer.refresh_all")
85 layout.prop(st, "preview_channels", expand=True, text="")
86 layout.prop(st, "display_channel", text="Channel")
88 ed = context.scene.sequence_editor
90 row = layout.row(align=True)
91 row.prop(ed, "show_overlay", text="", icon='GHOST_ENABLED')
93 row.prop(ed, "overlay_frame", text="")
94 row.prop(ed, "use_overlay_lock", text="", icon='LOCKED')
97 row.prop(st, "overlay_type", text="")
99 row = layout.row(align=True)
100 row.operator("render.opengl", text="", icon='RENDER_STILL').sequencer = True
101 props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION')
102 props.animation = True
103 props.sequencer = True
105 layout.template_running_jobs()
108 class SEQUENCER_MT_editor_menus(Menu):
109 bl_idname = "SEQUENCER_MT_editor_menus"
112 def draw(self, context):
113 self.draw_menus(self.layout, context)
116 def draw_menus(layout, context):
117 st = context.space_data
119 layout.menu("SEQUENCER_MT_view")
121 if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
122 layout.menu("SEQUENCER_MT_select")
123 layout.menu("SEQUENCER_MT_marker")
124 layout.menu("SEQUENCER_MT_add")
125 layout.menu("SEQUENCER_MT_strip")
128 class SEQUENCER_MT_view_toggle(Menu):
129 bl_label = "View Type"
131 def draw(self, context):
134 layout.operator("sequencer.view_toggle").type = 'SEQUENCER'
135 layout.operator("sequencer.view_toggle").type = 'PREVIEW'
136 layout.operator("sequencer.view_toggle").type = 'SEQUENCER_PREVIEW'
139 class SEQUENCER_MT_view(Menu):
142 def draw(self, context):
145 st = context.space_data
147 if st.view_type in {'PREVIEW'}:
148 # Specifying the REGION_PREVIEW context is needed in preview-only
149 # mode, else the lookup for the shortcut will fail in
150 # wm_keymap_item_find_props() (see #32595).
151 layout.operator_context = 'INVOKE_REGION_PREVIEW'
152 layout.operator("sequencer.properties", icon='MENU_PANEL')
153 layout.operator_context = 'INVOKE_DEFAULT'
157 if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
158 layout.operator("sequencer.view_all", text="View all Sequences")
159 layout.operator("sequencer.view_selected")
160 if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
161 layout.operator_context = 'INVOKE_REGION_PREVIEW'
162 layout.operator("sequencer.view_all_preview", text="Fit preview in window")
163 layout.operator("sequencer.view_zoom_ratio", text="Show preview 1:1").ratio = 1.0
164 layout.operator_context = 'INVOKE_DEFAULT'
166 # # XXX, invokes in the header view
167 # layout.operator("sequencer.view_ghost_border", text="Overlay Border")
169 if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
170 layout.prop(st, "show_seconds")
171 layout.prop(st, "show_frame_indicator")
173 if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
174 if st.display_mode == 'IMAGE':
175 layout.prop(st, "show_safe_margin")
176 elif st.display_mode == 'WAVEFORM':
177 layout.prop(st, "show_separate_color")
181 if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
182 layout.prop(st, "use_marker_sync")
185 layout.operator("screen.area_dupli")
186 layout.operator("screen.screen_full_area")
189 class SEQUENCER_MT_select(Menu):
192 def draw(self, context):
195 layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
196 layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
198 layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
199 layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
200 layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT'
202 layout.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
203 layout.operator("sequencer.select_linked")
204 layout.operator("sequencer.select_all").action = 'TOGGLE'
205 layout.operator("sequencer.select_all", text="Inverse").action = 'INVERT'
208 class SEQUENCER_MT_marker(Menu):
211 def draw(self, context):
214 from bl_ui.space_time import marker_menu_generic
215 marker_menu_generic(layout)
218 class SEQUENCER_MT_change(Menu):
221 def draw(self, context):
224 layout.operator_context = 'INVOKE_REGION_WIN'
226 layout.operator_menu_enum("sequencer.change_effect_input", "swap")
227 layout.operator_menu_enum("sequencer.change_effect_type", "type")
228 layout.operator("sequencer.change_path", text="Path/Files")
231 class SEQUENCER_MT_add(Menu):
234 def draw(self, context):
237 layout.operator_context = 'INVOKE_REGION_WIN'
239 if len(bpy.data.scenes) > 10:
240 layout.operator_context = 'INVOKE_DEFAULT'
241 layout.operator("sequencer.scene_strip_add", text="Scene...")
243 layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...")
245 if len(bpy.data.movieclips) > 10:
246 layout.operator_context = 'INVOKE_DEFAULT'
247 layout.operator("sequencer.movieclip_strip_add", text="Clips...")
249 layout.operator_menu_enum("sequencer.movieclip_strip_add", "clip", text="Clip...")
251 if len(bpy.data.masks) > 10:
252 layout.operator_context = 'INVOKE_DEFAULT'
253 layout.operator("sequencer.mask_strip_add", text="Masks...")
255 layout.operator_menu_enum("sequencer.mask_strip_add", "mask", text="Mask...")
257 layout.operator("sequencer.movie_strip_add", text="Movie")
258 layout.operator("sequencer.image_strip_add", text="Image")
259 layout.operator("sequencer.sound_strip_add", text="Sound")
261 layout.menu("SEQUENCER_MT_add_effect")
264 class SEQUENCER_MT_add_effect(Menu):
265 bl_label = "Effect Strip..."
267 def draw(self, context):
270 layout.operator_context = 'INVOKE_REGION_WIN'
272 layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
273 layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT'
274 layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
275 layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
276 layout.operator("sequencer.effect_strip_add", text="Cross").type = 'CROSS'
277 layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS'
278 layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY'
279 layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP'
280 layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE'
281 layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW'
282 layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM'
283 layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
284 layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
285 layout.operator("sequencer.effect_strip_add", text="Multicam Selector").type = 'MULTICAM'
286 layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
289 class SEQUENCER_MT_strip(Menu):
292 def draw(self, context):
295 layout.operator_context = 'INVOKE_REGION_WIN'
297 layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
298 layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
299 layout.operator("sequencer.gap_remove")
300 layout.operator("sequencer.gap_insert")
302 # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
305 layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
306 layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
307 layout.operator("sequencer.images_separate")
308 layout.operator("sequencer.offset_clear")
309 layout.operator("sequencer.deinterlace_selected_movies")
310 layout.operator("sequencer.rebuild_proxy")
313 layout.operator("sequencer.duplicate_move")
314 layout.operator("sequencer.delete")
316 strip = act_strip(context)
321 # XXX note strip.type is never equal to 'EFFECT', look at seq_type_items within rna_sequencer.c
322 if stype == 'EFFECT':
325 # layout.operator("sequencer.effect_change")
326 # layout.operator("sequencer.effect_reassign_inputs")
327 elif stype == 'IMAGE':
329 # layout.operator("sequencer.image_change")
330 layout.operator("sequencer.rendersize")
331 elif stype == 'SCENE':
334 # layout.operator("sequencer.scene_change", text="Change Scene")
335 elif stype == 'MOVIE':
337 # layout.operator("sequencer.movie_change")
338 layout.operator("sequencer.rendersize")
339 elif stype == 'SOUND':
341 layout.operator("sequencer.crossfade_sounds")
345 layout.operator("sequencer.meta_make")
346 layout.operator("sequencer.meta_separate")
348 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
350 # uiItemO(layout, NULL, 0, "sequencer.meta_toggle");
354 layout.operator("sequencer.reload", text="Reload Strips").adjust_length = False
355 layout.operator("sequencer.reload", text="Reload Strips and Adjust Length").adjust_length = True
356 layout.operator("sequencer.reassign_inputs")
357 layout.operator("sequencer.swap_inputs")
360 layout.operator("sequencer.lock")
361 layout.operator("sequencer.unlock")
362 layout.operator("sequencer.mute").unselected = False
363 layout.operator("sequencer.unmute")
365 layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
367 layout.operator("sequencer.snap")
369 layout.operator_menu_enum("sequencer.swap", "side")
373 layout.operator("sequencer.swap_data")
374 layout.menu("SEQUENCER_MT_change")
377 class SequencerButtonsPanel():
378 bl_space_type = 'SEQUENCE_EDITOR'
379 bl_region_type = 'UI'
382 def has_sequencer(context):
383 return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
386 def poll(cls, context):
387 return cls.has_sequencer(context) and (act_strip(context) is not None)
390 class SequencerButtonsPanel_Output():
391 bl_space_type = 'SEQUENCE_EDITOR'
392 bl_region_type = 'UI'
395 def has_preview(context):
396 return (context.space_data.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'})
399 def poll(cls, context):
400 return cls.has_preview(context)
403 class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
404 bl_label = "Edit Strip"
406 def draw(self, context):
409 scene = context.scene
410 frame_current = scene.frame_current
411 strip = act_strip(context)
413 split = layout.split(percentage=0.3)
414 split.label(text="Name:")
415 split.prop(strip, "name", text="")
417 split = layout.split(percentage=0.3)
418 split.label(text="Type:")
419 split.prop(strip, "type", text="")
421 if strip.type not in {'SOUND'}:
422 split = layout.split(percentage=0.3)
423 split.label(text="Blend:")
424 split.prop(strip, "blend_type", text="")
426 row = layout.row(align=True)
427 sub = row.row(align=True)
428 sub.active = (not strip.mute)
429 sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
430 row.prop(strip, "mute", toggle=True, icon_only=True)
431 row.prop(strip, "lock", toggle=True, icon_only=True)
433 row = layout.row(align=True)
434 row.prop(strip, "mute", toggle=True, icon_only=True)
435 row.prop(strip, "lock", toggle=True, icon_only=True)
437 col = layout.column()
439 sub.enabled = not strip.lock
440 sub.prop(strip, "channel")
441 sub.prop(strip, "frame_start")
442 sub.prop(strip, "frame_final_duration")
444 col = layout.column(align=True)
445 row = col.row(align=True)
446 row.label(text=iface_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
448 row = col.row(align=True)
449 row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
450 row.label(text=iface_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
452 col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
454 col.label(text=iface_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
458 if strip.type == 'IMAGE':
459 elem = strip.strip_elem_from_frame(frame_current)
460 elif strip.type == 'MOVIE':
461 elem = strip.elements[0]
463 if elem and elem.orig_width > 0 and elem.orig_height > 0:
464 col.label(text=iface_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
466 col.label(text="Original Dimension: None")
469 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
470 bl_label = "Effect Strip"
473 def poll(cls, context):
474 if not cls.has_sequencer(context):
477 strip = act_strip(context)
481 return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
482 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
483 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
486 def draw(self, context):
489 strip = act_strip(context)
491 if strip.input_count > 0:
492 col = layout.column()
493 col.prop(strip, "input_1")
494 if strip.input_count > 1:
495 col.prop(strip, "input_2")
497 if strip.type == 'COLOR':
498 layout.prop(strip, "color")
500 elif strip.type == 'WIPE':
501 col = layout.column()
502 col.prop(strip, "transition_type")
503 col.label(text="Direction:")
504 col.row().prop(strip, "direction", expand=True)
506 col = layout.column()
507 col.prop(strip, "blur_width", slider=True)
508 if strip.transition_type in {'SINGLE', 'DOUBLE'}:
509 col.prop(strip, "angle")
511 elif strip.type == 'GLOW':
512 flow = layout.column_flow()
513 flow.prop(strip, "threshold", slider=True)
514 flow.prop(strip, "clamp", slider=True)
515 flow.prop(strip, "boost_factor")
516 flow.prop(strip, "blur_radius")
519 row.prop(strip, "quality", slider=True)
520 row.prop(strip, "use_only_boost")
522 elif strip.type == 'SPEED':
523 layout.prop(strip, "use_default_fade", "Stretch to input strip length")
524 if not strip.use_default_fade:
525 layout.prop(strip, "use_as_speed")
526 if strip.use_as_speed:
527 layout.prop(strip, "speed_factor")
529 layout.prop(strip, "speed_factor", text="Frame number")
530 layout.prop(strip, "scale_to_length")
532 elif strip.type == 'TRANSFORM':
534 col = layout.column()
536 col.prop(strip, "interpolation")
537 col.prop(strip, "translation_unit")
538 col = layout.column(align=True)
539 col.label(text="Position:")
540 col.prop(strip, "translate_start_x", text="X")
541 col.prop(strip, "translate_start_y", text="Y")
545 col = layout.column(align=True)
546 col.prop(strip, "use_uniform_scale")
547 if strip.use_uniform_scale:
548 col = layout.column(align=True)
549 col.prop(strip, "scale_start_x", text="Scale")
551 col = layout.column(align=True)
552 col.label(text="Scale:")
553 col.prop(strip, "scale_start_x", text="X")
554 col.prop(strip, "scale_start_y", text="Y")
558 col = layout.column(align=True)
559 col.label(text="Rotation:")
560 col.prop(strip, "rotation_start", text="Rotation")
562 elif strip.type == 'MULTICAM':
563 layout.prop(strip, "multicam_source")
565 row = layout.row(align=True)
566 sub = row.row(align=True)
569 sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY')
572 for i in range(1, strip.channel):
573 row.operator("sequencer.cut_multicam", text="%d" % i).camera = i
575 col = layout.column(align=True)
576 if strip.type == 'SPEED':
577 col.prop(strip, "multiply_speed")
578 elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE'}:
579 col.prop(strip, "use_default_fade", "Default fade")
580 if not strip.use_default_fade:
581 col.prop(strip, "effect_fader", text="Effect fader")
584 class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
585 bl_label = "Strip Input"
588 def poll(cls, context):
589 if not cls.has_sequencer(context):
592 strip = act_strip(context)
596 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'META',
597 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
598 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
599 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
600 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
602 def draw(self, context):
605 strip = act_strip(context)
607 seq_type = strip.type
609 # draw a filename if we have one
610 if seq_type == 'IMAGE':
611 split = layout.split(percentage=0.2)
612 split.label(text="Path:")
613 split.prop(strip, "directory", text="")
615 # Current element for the filename
617 elem = strip.strip_elem_from_frame(context.scene.frame_current)
619 split = layout.split(percentage=0.2)
620 split.label(text="File:")
621 split.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
623 layout.prop(strip.colorspace_settings, "name")
624 layout.prop(strip, "alpha_mode")
626 layout.operator("sequencer.change_path")
628 elif seq_type == 'MOVIE':
629 split = layout.split(percentage=0.2)
630 split.label(text="Path:")
631 split.prop(strip, "filepath", text="")
633 layout.prop(strip.colorspace_settings, "name")
635 layout.prop(strip, "mpeg_preseek")
636 layout.prop(strip, "stream_index")
638 layout.prop(strip, "use_translation", text="Image Offset")
639 if strip.use_translation:
640 col = layout.column(align=True)
641 col.prop(strip.transform, "offset_x", text="X")
642 col.prop(strip.transform, "offset_y", text="Y")
644 layout.prop(strip, "use_crop", text="Image Crop")
646 col = layout.column(align=True)
647 col.prop(strip.crop, "max_y")
648 col.prop(strip.crop, "min_x")
649 col.prop(strip.crop, "min_y")
650 col.prop(strip.crop, "max_x")
652 if not isinstance(strip, bpy.types.EffectSequence):
653 col = layout.column(align=True)
654 col.label(text="Trim Duration (hard):")
655 col.prop(strip, "animation_offset_start", text="Start")
656 col.prop(strip, "animation_offset_end", text="End")
658 col = layout.column(align=True)
659 col.label(text="Trim Duration (soft):")
660 col.prop(strip, "frame_offset_start", text="Start")
661 col.prop(strip, "frame_offset_end", text="End")
664 class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
668 def poll(cls, context):
669 if not cls.has_sequencer(context):
672 strip = act_strip(context)
676 return (strip.type == 'SOUND')
678 def draw(self, context):
681 strip = act_strip(context)
684 layout.template_ID(strip, "sound", open="sound.open")
687 layout.prop(strip, "filepath", text="")
689 if sound is not None:
691 if sound.packed_file:
692 row.operator("sound.unpack", icon='PACKAGE', text="Unpack")
694 row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack")
696 row.prop(sound, "use_memory_cache")
698 layout.prop(strip, "show_waveform")
699 layout.prop(strip, "volume")
700 layout.prop(strip, "pitch")
701 layout.prop(strip, "pan")
703 col = layout.column(align=True)
704 col.label(text="Trim Duration (hard):")
705 col.prop(strip, "animation_offset_start", text="Start")
706 col.prop(strip, "animation_offset_end", text="End")
708 col = layout.column(align=True)
709 col.label(text="Trim Duration (soft):")
710 col.prop(strip, "frame_offset_start", text="Start")
711 col.prop(strip, "frame_offset_end", text="End")
714 class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
718 def poll(cls, context):
719 if not cls.has_sequencer(context):
722 strip = act_strip(context)
726 return (strip.type == 'SCENE')
728 def draw(self, context):
731 strip = act_strip(context)
733 layout.template_ID(strip, "scene")
737 layout.label(text="Camera Override")
738 layout.template_ID(strip, "scene_camera")
741 layout.prop(scene, "audio_volume", text="Audio Volume")
743 sta = scene.frame_start
744 end = scene.frame_end
745 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
748 class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
752 def poll(cls, context):
753 if not cls.has_sequencer(context):
756 strip = act_strip(context)
760 return (strip.type == 'MASK')
762 def draw(self, context):
765 strip = act_strip(context)
767 layout.template_ID(strip, "mask")
772 sta = mask.frame_start
774 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
777 class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
781 def poll(cls, context):
782 if not cls.has_sequencer(context):
785 strip = act_strip(context)
789 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'MASK',
790 'META', 'ADD', 'SUBTRACT', 'ALPHA_OVER',
791 'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY',
792 'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
793 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
795 def draw(self, context):
798 strip = act_strip(context)
800 col = layout.column()
801 col.label(text="Video:")
802 col.prop(strip, "strobe")
804 if strip.type == 'MOVIECLIP':
805 col = layout.column()
806 col.label(text="Tracker:")
807 col.prop(strip, "stabilize2d")
809 col = layout.column()
810 col.label(text="Distortion:")
811 col.prop(strip, "undistort")
813 split = layout.split(percentage=0.65)
816 col.prop(strip, "use_reverse_frames", text="Backwards")
817 col.prop(strip, "use_deinterlace")
820 col.label(text="Flip:")
821 col.prop(strip, "use_flip_x", text="X")
822 col.prop(strip, "use_flip_y", text="Y")
824 col = layout.column()
825 col.label(text="Colors:")
826 col.prop(strip, "color_saturation", text="Saturation")
827 col.prop(strip, "color_multiply", text="Multiply")
828 col.prop(strip, "use_float")
831 class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
832 bl_label = "Proxy / Timecode"
835 def poll(cls, context):
836 if not cls.has_sequencer(context):
839 strip = act_strip(context)
843 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'META', 'MULTICAM'}
845 def draw_header(self, context):
846 strip = act_strip(context)
848 self.layout.prop(strip, "use_proxy", text="")
850 def draw(self, context):
853 strip = act_strip(context)
855 flow = layout.column_flow()
856 flow.prop(strip, "use_proxy_custom_directory")
857 flow.prop(strip, "use_proxy_custom_file")
859 if strip.use_proxy_custom_directory and not strip.use_proxy_custom_file:
860 flow.prop(strip.proxy, "directory")
861 if strip.use_proxy_custom_file:
862 flow.prop(strip.proxy, "filepath")
865 row.prop(strip.proxy, "build_25")
866 row.prop(strip.proxy, "build_50")
867 row.prop(strip.proxy, "build_75")
868 row.prop(strip.proxy, "build_100")
870 col = layout.column()
871 col.label(text="Build JPEG quality")
872 col.prop(strip.proxy, "quality")
874 if strip.type == 'MOVIE':
875 col = layout.column()
876 col.label(text="Use timecode index:")
878 col.prop(strip.proxy, "timecode")
881 class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
882 bl_label = "Scene Preview/Render"
883 bl_space_type = 'SEQUENCE_EDITOR'
884 bl_region_type = 'UI'
886 def draw(self, context):
889 render = context.scene.render
891 col = layout.column()
892 col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
893 col = layout.column()
894 #col.active = render.use_sequencer_gl_preview
895 col.prop(render, "sequencer_gl_preview", text="")
898 row.active = render.sequencer_gl_preview == 'SOLID'
899 row.prop(render, "use_sequencer_gl_textured_solid")
902 class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
903 bl_label = "View Settings"
905 def draw(self, context):
908 st = context.space_data
910 col = layout.column()
911 if st.display_mode == 'IMAGE':
912 col.prop(st, "draw_overexposed")
913 col.prop(st, "show_safe_margin")
914 elif st.display_mode == 'WAVEFORM':
915 col.prop(st, "show_separate_color")
916 col.prop(st, "proxy_render_size")
919 class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
920 bl_label = "Modifiers"
922 def draw(self, context):
925 strip = act_strip(context)
926 sequencer = context.scene.sequence_editor
928 layout.prop(strip, "use_linear_modifiers")
930 layout.operator_menu_enum("sequencer.strip_modifier_add", "type")
932 for mod in strip.modifiers:
936 row.prop(mod, "show_expanded", text="", emboss=False)
937 row.prop(mod, "name", text="")
939 row.prop(mod, "mute", text="")
941 sub = row.row(align=True)
942 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_UP')
943 props.name = mod.name
944 props.direction = 'UP'
945 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_DOWN')
946 props.name = mod.name
947 props.direction = 'DOWN'
949 row.operator("sequencer.strip_modifier_remove", text="", icon='X', emboss=False).name = mod.name
951 if mod.show_expanded:
953 row.prop(mod, "input_mask_type", expand=True)
955 if mod.input_mask_type == 'STRIP':
956 sequences_object = sequencer
957 if sequencer.meta_stack:
958 sequences_object = sequencer.meta_stack[-1]
959 box.prop_search(mod, "input_mask_strip", sequences_object, "sequences", text="Mask")
961 box.prop(mod, "input_mask_id")
963 if mod.type == 'COLOR_BALANCE':
964 box.prop(mod, "color_multiply")
965 draw_color_balance(box, mod.color_balance)
966 elif mod.type == 'CURVES':
967 box.template_curve_mapping(mod, "curve_mapping", type='COLOR')
968 elif mod.type == 'HUE_CORRECT':
969 box.template_curve_mapping(mod, "curve_mapping", type='HUE')
970 elif mod.type == 'BRIGHT_CONTRAST':
972 col.prop(mod, "bright")
973 col.prop(mod, "contrast")
976 if __name__ == "__main__": # only for live edit.
977 bpy.utils.register_module(__name__)