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")
166 ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
169 layout.operator("sequencer.view_zoom_ratio", text=iface_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
173 layout.operator_context = 'INVOKE_DEFAULT'
175 # # XXX, invokes in the header view
176 # layout.operator("sequencer.view_ghost_border", text="Overlay Border")
178 if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
179 layout.prop(st, "show_seconds")
180 layout.prop(st, "show_frame_indicator")
182 if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
183 if st.display_mode == 'IMAGE':
184 layout.prop(st, "show_safe_margin")
185 elif st.display_mode == 'WAVEFORM':
186 layout.prop(st, "show_separate_color")
190 if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
191 layout.prop(st, "use_marker_sync")
194 layout.operator("screen.area_dupli")
195 layout.operator("screen.screen_full_area")
198 class SEQUENCER_MT_select(Menu):
201 def draw(self, context):
204 layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
205 layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
207 layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
208 layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
209 layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT'
211 layout.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
212 layout.operator("sequencer.select_linked")
213 layout.operator("sequencer.select_all").action = 'TOGGLE'
214 layout.operator("sequencer.select_all", text="Inverse").action = 'INVERT'
217 class SEQUENCER_MT_marker(Menu):
220 def draw(self, context):
223 from bl_ui.space_time import marker_menu_generic
224 marker_menu_generic(layout)
227 class SEQUENCER_MT_change(Menu):
230 def draw(self, context):
233 layout.operator_context = 'INVOKE_REGION_WIN'
235 layout.operator_menu_enum("sequencer.change_effect_input", "swap")
236 layout.operator_menu_enum("sequencer.change_effect_type", "type")
237 layout.operator("sequencer.change_path", text="Path/Files")
240 class SEQUENCER_MT_add(Menu):
243 def draw(self, context):
246 layout.operator_context = 'INVOKE_REGION_WIN'
248 if len(bpy.data.scenes) > 10:
249 layout.operator_context = 'INVOKE_DEFAULT'
250 layout.operator("sequencer.scene_strip_add", text="Scene...")
252 layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...")
254 if len(bpy.data.movieclips) > 10:
255 layout.operator_context = 'INVOKE_DEFAULT'
256 layout.operator("sequencer.movieclip_strip_add", text="Clips...")
258 layout.operator_menu_enum("sequencer.movieclip_strip_add", "clip", text="Clip...")
260 if len(bpy.data.masks) > 10:
261 layout.operator_context = 'INVOKE_DEFAULT'
262 layout.operator("sequencer.mask_strip_add", text="Masks...")
264 layout.operator_menu_enum("sequencer.mask_strip_add", "mask", text="Mask...")
266 layout.operator("sequencer.movie_strip_add", text="Movie")
267 layout.operator("sequencer.image_strip_add", text="Image")
268 layout.operator("sequencer.sound_strip_add", text="Sound")
270 layout.menu("SEQUENCER_MT_add_effect")
273 class SEQUENCER_MT_add_effect(Menu):
274 bl_label = "Effect Strip..."
276 def draw(self, context):
279 layout.operator_context = 'INVOKE_REGION_WIN'
281 layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
282 layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT'
283 layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
284 layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
285 layout.operator("sequencer.effect_strip_add", text="Cross").type = 'CROSS'
286 layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS'
287 layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY'
288 layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP'
289 layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE'
290 layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW'
291 layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM'
292 layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
293 layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
294 layout.operator("sequencer.effect_strip_add", text="Multicam Selector").type = 'MULTICAM'
295 layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
298 class SEQUENCER_MT_strip(Menu):
301 def draw(self, context):
304 layout.operator_context = 'INVOKE_REGION_WIN'
306 layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
307 layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
308 layout.operator("sequencer.gap_remove")
309 layout.operator("sequencer.gap_insert")
311 # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
314 layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
315 layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
316 layout.operator("sequencer.images_separate")
317 layout.operator("sequencer.offset_clear")
318 layout.operator("sequencer.deinterlace_selected_movies")
319 layout.operator("sequencer.rebuild_proxy")
322 layout.operator("sequencer.duplicate_move")
323 layout.operator("sequencer.delete")
325 strip = act_strip(context)
330 # XXX note strip.type is never equal to 'EFFECT', look at seq_type_items within rna_sequencer.c
331 if stype == 'EFFECT':
334 # layout.operator("sequencer.effect_change")
335 # layout.operator("sequencer.effect_reassign_inputs")
336 elif stype == 'IMAGE':
338 # layout.operator("sequencer.image_change")
339 layout.operator("sequencer.rendersize")
340 elif stype == 'SCENE':
343 # layout.operator("sequencer.scene_change", text="Change Scene")
344 elif stype == 'MOVIE':
346 # layout.operator("sequencer.movie_change")
347 layout.operator("sequencer.rendersize")
348 elif stype == 'SOUND':
350 layout.operator("sequencer.crossfade_sounds")
354 layout.operator("sequencer.meta_make")
355 layout.operator("sequencer.meta_separate")
357 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
359 # uiItemO(layout, NULL, 0, "sequencer.meta_toggle");
363 layout.operator("sequencer.reload", text="Reload Strips").adjust_length = False
364 layout.operator("sequencer.reload", text="Reload Strips and Adjust Length").adjust_length = True
365 layout.operator("sequencer.reassign_inputs")
366 layout.operator("sequencer.swap_inputs")
369 layout.operator("sequencer.lock")
370 layout.operator("sequencer.unlock")
371 layout.operator("sequencer.mute").unselected = False
372 layout.operator("sequencer.unmute")
374 layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
376 layout.operator("sequencer.snap")
378 layout.operator_menu_enum("sequencer.swap", "side")
382 layout.operator("sequencer.swap_data")
383 layout.menu("SEQUENCER_MT_change")
386 class SequencerButtonsPanel():
387 bl_space_type = 'SEQUENCE_EDITOR'
388 bl_region_type = 'UI'
391 def has_sequencer(context):
392 return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
395 def poll(cls, context):
396 return cls.has_sequencer(context) and (act_strip(context) is not None)
399 class SequencerButtonsPanel_Output():
400 bl_space_type = 'SEQUENCE_EDITOR'
401 bl_region_type = 'UI'
404 def has_preview(context):
405 return (context.space_data.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'})
408 def poll(cls, context):
409 return cls.has_preview(context)
412 class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
413 bl_label = "Edit Strip"
415 def draw(self, context):
418 scene = context.scene
419 frame_current = scene.frame_current
420 strip = act_strip(context)
422 split = layout.split(percentage=0.3)
423 split.label(text="Name:")
424 split.prop(strip, "name", text="")
426 split = layout.split(percentage=0.3)
427 split.label(text="Type:")
428 split.prop(strip, "type", text="")
430 if strip.type not in {'SOUND'}:
431 split = layout.split(percentage=0.3)
432 split.label(text="Blend:")
433 split.prop(strip, "blend_type", text="")
435 row = layout.row(align=True)
436 sub = row.row(align=True)
437 sub.active = (not strip.mute)
438 sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
439 row.prop(strip, "mute", toggle=True, icon_only=True)
440 row.prop(strip, "lock", toggle=True, icon_only=True)
442 row = layout.row(align=True)
443 row.prop(strip, "mute", toggle=True, icon_only=True)
444 row.prop(strip, "lock", toggle=True, icon_only=True)
446 col = layout.column()
448 sub.enabled = not strip.lock
449 sub.prop(strip, "channel")
450 sub.prop(strip, "frame_start")
451 sub.prop(strip, "frame_final_duration")
453 col = layout.column(align=True)
454 row = col.row(align=True)
455 row.label(text=iface_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
457 row = col.row(align=True)
458 row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
459 row.label(text=iface_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
461 col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
463 col.label(text=iface_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
467 if strip.type == 'IMAGE':
468 elem = strip.strip_elem_from_frame(frame_current)
469 elif strip.type == 'MOVIE':
470 elem = strip.elements[0]
472 if elem and elem.orig_width > 0 and elem.orig_height > 0:
473 col.label(text=iface_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
475 col.label(text="Original Dimension: None")
478 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
479 bl_label = "Effect Strip"
482 def poll(cls, context):
483 if not cls.has_sequencer(context):
486 strip = act_strip(context)
490 return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
491 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
492 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
495 def draw(self, context):
498 strip = act_strip(context)
500 if strip.input_count > 0:
501 col = layout.column()
502 col.prop(strip, "input_1")
503 if strip.input_count > 1:
504 col.prop(strip, "input_2")
506 if strip.type == 'COLOR':
507 layout.prop(strip, "color")
509 elif strip.type == 'WIPE':
510 col = layout.column()
511 col.prop(strip, "transition_type")
512 col.label(text="Direction:")
513 col.row().prop(strip, "direction", expand=True)
515 col = layout.column()
516 col.prop(strip, "blur_width", slider=True)
517 if strip.transition_type in {'SINGLE', 'DOUBLE'}:
518 col.prop(strip, "angle")
520 elif strip.type == 'GLOW':
521 flow = layout.column_flow()
522 flow.prop(strip, "threshold", slider=True)
523 flow.prop(strip, "clamp", slider=True)
524 flow.prop(strip, "boost_factor")
525 flow.prop(strip, "blur_radius")
528 row.prop(strip, "quality", slider=True)
529 row.prop(strip, "use_only_boost")
531 elif strip.type == 'SPEED':
532 layout.prop(strip, "use_default_fade", "Stretch to input strip length")
533 if not strip.use_default_fade:
534 layout.prop(strip, "use_as_speed")
535 if strip.use_as_speed:
536 layout.prop(strip, "speed_factor")
538 layout.prop(strip, "speed_factor", text="Frame number")
539 layout.prop(strip, "scale_to_length")
541 elif strip.type == 'TRANSFORM':
543 col = layout.column()
545 col.prop(strip, "interpolation")
546 col.prop(strip, "translation_unit")
547 col = layout.column(align=True)
548 col.label(text="Position:")
549 col.prop(strip, "translate_start_x", text="X")
550 col.prop(strip, "translate_start_y", text="Y")
554 col = layout.column(align=True)
555 col.prop(strip, "use_uniform_scale")
556 if strip.use_uniform_scale:
557 col = layout.column(align=True)
558 col.prop(strip, "scale_start_x", text="Scale")
560 col = layout.column(align=True)
561 col.label(text="Scale:")
562 col.prop(strip, "scale_start_x", text="X")
563 col.prop(strip, "scale_start_y", text="Y")
567 col = layout.column(align=True)
568 col.label(text="Rotation:")
569 col.prop(strip, "rotation_start", text="Rotation")
571 elif strip.type == 'MULTICAM':
572 layout.prop(strip, "multicam_source")
574 row = layout.row(align=True)
575 sub = row.row(align=True)
578 sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY')
581 for i in range(1, strip.channel):
582 row.operator("sequencer.cut_multicam", text="%d" % i).camera = i
584 col = layout.column(align=True)
585 if strip.type == 'SPEED':
586 col.prop(strip, "multiply_speed")
587 elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE'}:
588 col.prop(strip, "use_default_fade", "Default fade")
589 if not strip.use_default_fade:
590 col.prop(strip, "effect_fader", text="Effect fader")
593 class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
594 bl_label = "Strip Input"
597 def poll(cls, context):
598 if not cls.has_sequencer(context):
601 strip = act_strip(context)
605 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'META',
606 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
607 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
608 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
609 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
611 def draw(self, context):
614 strip = act_strip(context)
616 seq_type = strip.type
618 # draw a filename if we have one
619 if seq_type == 'IMAGE':
620 split = layout.split(percentage=0.2)
621 split.label(text="Path:")
622 split.prop(strip, "directory", text="")
624 # Current element for the filename
626 elem = strip.strip_elem_from_frame(context.scene.frame_current)
628 split = layout.split(percentage=0.2)
629 split.label(text="File:")
630 split.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
632 layout.prop(strip.colorspace_settings, "name")
633 layout.prop(strip, "alpha_mode")
635 layout.operator("sequencer.change_path")
637 elif seq_type == 'MOVIE':
638 split = layout.split(percentage=0.2)
639 split.label(text="Path:")
640 split.prop(strip, "filepath", text="")
642 layout.prop(strip.colorspace_settings, "name")
644 layout.prop(strip, "mpeg_preseek")
645 layout.prop(strip, "stream_index")
647 layout.prop(strip, "use_translation", text="Image Offset")
648 if strip.use_translation:
649 col = layout.column(align=True)
650 col.prop(strip.transform, "offset_x", text="X")
651 col.prop(strip.transform, "offset_y", text="Y")
653 layout.prop(strip, "use_crop", text="Image Crop")
655 col = layout.column(align=True)
656 col.prop(strip.crop, "max_y")
657 col.prop(strip.crop, "min_x")
658 col.prop(strip.crop, "min_y")
659 col.prop(strip.crop, "max_x")
661 if not isinstance(strip, bpy.types.EffectSequence):
662 col = layout.column(align=True)
663 col.label(text="Trim Duration (hard):")
664 col.prop(strip, "animation_offset_start", text="Start")
665 col.prop(strip, "animation_offset_end", text="End")
667 col = layout.column(align=True)
668 col.label(text="Trim Duration (soft):")
669 col.prop(strip, "frame_offset_start", text="Start")
670 col.prop(strip, "frame_offset_end", text="End")
673 class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
677 def poll(cls, context):
678 if not cls.has_sequencer(context):
681 strip = act_strip(context)
685 return (strip.type == 'SOUND')
687 def draw(self, context):
690 strip = act_strip(context)
693 layout.template_ID(strip, "sound", open="sound.open")
696 layout.prop(strip, "filepath", text="")
698 if sound is not None:
700 if sound.packed_file:
701 row.operator("sound.unpack", icon='PACKAGE', text="Unpack")
703 row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack")
705 row.prop(sound, "use_memory_cache")
707 layout.prop(strip, "show_waveform")
708 layout.prop(strip, "volume")
709 layout.prop(strip, "pitch")
710 layout.prop(strip, "pan")
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")
723 class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
727 def poll(cls, context):
728 if not cls.has_sequencer(context):
731 strip = act_strip(context)
735 return (strip.type == 'SCENE')
737 def draw(self, context):
740 strip = act_strip(context)
742 layout.template_ID(strip, "scene")
746 layout.label(text="Camera Override")
747 layout.template_ID(strip, "scene_camera")
750 layout.prop(scene, "audio_volume", text="Audio Volume")
752 sta = scene.frame_start
753 end = scene.frame_end
754 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
757 class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
761 def poll(cls, context):
762 if not cls.has_sequencer(context):
765 strip = act_strip(context)
769 return (strip.type == 'MASK')
771 def draw(self, context):
774 strip = act_strip(context)
776 layout.template_ID(strip, "mask")
781 sta = mask.frame_start
783 layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
786 class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
790 def poll(cls, context):
791 if not cls.has_sequencer(context):
794 strip = act_strip(context)
798 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'MASK',
799 'META', 'ADD', 'SUBTRACT', 'ALPHA_OVER',
800 'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY',
801 'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
802 'MULTICAM', 'SPEED', 'ADJUSTMENT'}
804 def draw(self, context):
807 strip = act_strip(context)
809 col = layout.column()
810 col.label(text="Video:")
811 col.prop(strip, "strobe")
813 if strip.type == 'MOVIECLIP':
814 col = layout.column()
815 col.label(text="Tracker:")
816 col.prop(strip, "stabilize2d")
818 col = layout.column()
819 col.label(text="Distortion:")
820 col.prop(strip, "undistort")
822 split = layout.split(percentage=0.65)
825 col.prop(strip, "use_reverse_frames", text="Backwards")
826 col.prop(strip, "use_deinterlace")
829 col.label(text="Flip:")
830 col.prop(strip, "use_flip_x", text="X")
831 col.prop(strip, "use_flip_y", text="Y")
833 col = layout.column()
834 col.label(text="Colors:")
835 col.prop(strip, "color_saturation", text="Saturation")
836 col.prop(strip, "color_multiply", text="Multiply")
837 col.prop(strip, "use_float")
840 class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
841 bl_label = "Proxy / Timecode"
844 def poll(cls, context):
845 if not cls.has_sequencer(context):
848 strip = act_strip(context)
852 return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'META', 'MULTICAM'}
854 def draw_header(self, context):
855 strip = act_strip(context)
857 self.layout.prop(strip, "use_proxy", text="")
859 def draw(self, context):
862 strip = act_strip(context)
864 flow = layout.column_flow()
865 flow.prop(strip, "use_proxy_custom_directory")
866 flow.prop(strip, "use_proxy_custom_file")
868 if strip.use_proxy_custom_directory and not strip.use_proxy_custom_file:
869 flow.prop(strip.proxy, "directory")
870 if strip.use_proxy_custom_file:
871 flow.prop(strip.proxy, "filepath")
874 row.prop(strip.proxy, "build_25")
875 row.prop(strip.proxy, "build_50")
876 row.prop(strip.proxy, "build_75")
877 row.prop(strip.proxy, "build_100")
879 col = layout.column()
880 col.label(text="Build JPEG quality")
881 col.prop(strip.proxy, "quality")
883 if strip.type == 'MOVIE':
884 col = layout.column()
885 col.label(text="Use timecode index:")
887 col.prop(strip.proxy, "timecode")
890 class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
891 bl_label = "Scene Preview/Render"
892 bl_space_type = 'SEQUENCE_EDITOR'
893 bl_region_type = 'UI'
895 def draw(self, context):
898 render = context.scene.render
900 col = layout.column()
901 col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
902 col = layout.column()
903 #col.active = render.use_sequencer_gl_preview
904 col.prop(render, "sequencer_gl_preview", text="")
907 row.active = render.sequencer_gl_preview == 'SOLID'
908 row.prop(render, "use_sequencer_gl_textured_solid")
911 class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
912 bl_label = "View Settings"
914 def draw(self, context):
917 st = context.space_data
919 col = layout.column()
920 if st.display_mode == 'IMAGE':
921 col.prop(st, "draw_overexposed")
922 col.prop(st, "show_safe_margin")
923 elif st.display_mode == 'WAVEFORM':
924 col.prop(st, "show_separate_color")
925 col.prop(st, "proxy_render_size")
928 class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
929 bl_label = "Modifiers"
931 def draw(self, context):
934 strip = act_strip(context)
935 sequencer = context.scene.sequence_editor
937 layout.prop(strip, "use_linear_modifiers")
939 layout.operator_menu_enum("sequencer.strip_modifier_add", "type")
941 for mod in strip.modifiers:
945 row.prop(mod, "show_expanded", text="", emboss=False)
946 row.prop(mod, "name", text="")
948 row.prop(mod, "mute", text="")
950 sub = row.row(align=True)
951 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_UP')
952 props.name = mod.name
953 props.direction = 'UP'
954 props = sub.operator("sequencer.strip_modifier_move", text="", icon='TRIA_DOWN')
955 props.name = mod.name
956 props.direction = 'DOWN'
958 row.operator("sequencer.strip_modifier_remove", text="", icon='X', emboss=False).name = mod.name
960 if mod.show_expanded:
962 row.prop(mod, "input_mask_type", expand=True)
964 if mod.input_mask_type == 'STRIP':
965 sequences_object = sequencer
966 if sequencer.meta_stack:
967 sequences_object = sequencer.meta_stack[-1]
968 box.prop_search(mod, "input_mask_strip", sequences_object, "sequences", text="Mask")
970 box.prop(mod, "input_mask_id")
972 if mod.type == 'COLOR_BALANCE':
973 box.prop(mod, "color_multiply")
974 draw_color_balance(box, mod.color_balance)
975 elif mod.type == 'CURVES':
976 box.template_curve_mapping(mod, "curve_mapping", type='COLOR')
977 elif mod.type == 'HUE_CORRECT':
978 box.template_curve_mapping(mod, "curve_mapping", type='HUE')
979 elif mod.type == 'BRIGHT_CONTRAST':
981 col.prop(mod, "bright")
982 col.prop(mod, "contrast")
985 if __name__ == "__main__": # only for live edit.
986 bpy.utils.register_module(__name__)