4 def act_strip(context):
5 try: return context.scene.sequence_editor.active_strip
9 class SEQUENCER_HT_header(bpy.types.Header):
10 __space_type__ = "SEQUENCE_EDITOR"
11 __idname__ = "SEQUENCE_HT_header"
13 def draw(self, context):
15 st = context.space_data
18 layout.template_header()
20 if context.area.show_menus:
22 row.itemM("SEQUENCER_MT_view")
24 row.itemR(st, "display_mode")
28 if st.display_mode == 'SEQUENCER':
29 row.itemM("SEQUENCER_MT_select")
30 row.itemM("SEQUENCER_MT_marker")
31 row.itemM("SEQUENCER_MT_add")
32 row.itemM("SEQUENCER_MT_strip")
34 row.itemO("SEQUENCER_OT_reload")
36 row.itemR(st, "display_channel") # text="Chan"
38 class SEQUENCER_MT_view(bpy.types.Menu):
39 __space_type__ = "SEQUENCE_EDITOR"
40 __label__ = "View (TODO)"
42 def draw(self, context):
44 st = context.space_data
49 uiBlock *block= uiBeginBlock(C, ar, "seq_viewmenu", UI_EMBOSSP);
50 short yco= 0, menuwidth=120;
52 if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
53 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
54 "Play Back Animation "
55 "in all Sequence Areas|Alt A", 0, yco-=20,
56 menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
59 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL,
60 "Grease Pencil...", 0, yco-=20,
61 menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
64 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
65 "Play Back Animation "
66 "in this window|Alt A", 0, yco-=20,
67 menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
69 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
70 "Play Back Animation in all "
71 "3D Views and Sequence Areas|Alt Shift A",
73 menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
77 layout.itemO("SEQUENCER_OT_view_all")
78 layout.itemO("SEQUENCER_OT_view_selected")
84 uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
85 "Lock Time to Other Windows|", 0, yco-=20,
86 menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
88 /* Draw time or frames.*/
92 layout.itemR(st, "draw_frames")
95 if(!sa->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,0, "");
96 else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
100 class SEQUENCER_MT_select(bpy.types.Menu):
101 __space_type__ = "SEQUENCE_EDITOR"
104 def draw(self, context):
106 st = context.space_data
109 layout.item_enumO("SEQUENCER_OT_select_active_side", "side", 'LEFT', text="Strips to the Left")
110 layout.item_enumO("SEQUENCER_OT_select_active_side", "side", 'RIGHT', text="Strips to the Right")
112 layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'BOTH', text="Surrounding Handles")
113 layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'LEFT', text="Left Handle")
114 layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'RIGHT', text="Right Handle")
116 layout.itemO("SEQUENCER_OT_select_linked")
117 layout.itemO("SEQUENCER_OT_select_all_toggle")
118 layout.itemO("SEQUENCER_OT_select_invert")
120 class SEQUENCER_MT_marker(bpy.types.Menu):
121 __space_type__ = "SEQUENCE_EDITOR"
122 __label__ = "Marker (TODO)"
124 def draw(self, context):
126 st = context.space_data
129 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Add Marker|Ctrl Alt M")
130 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Duplicate Marker|Ctrl Shift D")
131 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Delete Marker|Shift X")
133 layout.itemO("SEQUENCER_OT_sound_strip_add", text="(Re)Name Marker|Ctrl M")
134 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Grab/Move Marker|Ctrl G")
136 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
138 class SEQUENCER_MT_add(bpy.types.Menu):
139 __space_type__ = "SEQUENCE_EDITOR"
142 def draw(self, context):
144 st = context.space_data
147 layout.itemO("SEQUENCER_OT_scene_strip_add", text="Scene")
148 layout.itemO("SEQUENCER_OT_movie_strip_add", text="Movie")
149 layout.item_booleanO("SEQUENCER_OT_movie_strip_add", "sound", True, text="Movie & Sound") # FFMPEG ONLY
150 layout.itemO("SEQUENCER_OT_image_strip_add", text="Image")
151 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Sound (Ram)")
152 layout.item_booleanO("SEQUENCER_OT_sound_strip_add", "hd", True, text="Sound (Streaming)") # FFMPEG ONLY
154 layout.itemM("SEQUENCER_MT_add_effect")
157 class SEQUENCER_MT_add_effect(bpy.types.Menu):
158 __space_type__ = "SEQUENCE_EDITOR"
159 __label__ = "Effect Strip..."
161 def draw(self, context):
163 st = context.space_data
166 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ADD')
167 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'SUBTRACT')
168 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ALPHA_OVER')
169 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ALPHA_UNDER')
170 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'GAMMA_CROSS')
171 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'MULTIPLY')
172 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'OVER_DROP')
173 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'PLUGIN')
174 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'WIPE')
175 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'GLOW')
176 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'TRANSFORM')
177 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'COLOR')
178 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'SPEED')
180 class SEQUENCER_MT_strip(bpy.types.Menu):
181 __space_type__ = "SEQUENCE_EDITOR"
184 def draw(self, context):
186 st = context.space_data
188 layout.operator_context = 'INVOKE_REGION_WIN'
191 layout.item_enumO("TFM_OT_transform", "mode", 'TRANSLATION', text="Grab/Move")
192 layout.item_enumO("TFM_OT_transform", "mode", 'TIME_EXTEND', text="Grab/Extend from frame")
193 # uiItemO(layout, NULL, 0, "SEQUENCER_OT_strip_snap"); // TODO - add this operator
196 layout.item_enumO("SEQUENCER_OT_cut", "type", 'HARD', text="Cut (hard) at frame")
197 layout.item_enumO("SEQUENCER_OT_cut", "type", 'SOFT', text="Cut (soft) at frame")
198 layout.itemO("SEQUENCER_OT_images_separate")
201 layout.itemO("SEQUENCER_OT_duplicate_add")
202 layout.itemO("SEQUENCER_OT_delete")
204 strip = act_strip(context)
211 layout.itemO("SEQUENCER_OT_effect_change")
212 layout.itemO("SEQUENCER_OT_effect_reassign_inputs")
215 layout.itemO("SEQUENCER_OT_image_change")
218 layout.itemO("SEQUENCER_OT_scene_change", text="Change Scene")
221 layout.itemO("SEQUENCER_OT_movie_change")
225 layout.itemO("SEQUENCER_OT_meta_make")
226 layout.itemO("SEQUENCER_OT_meta_separate")
228 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
230 # uiItemO(layout, NULL, 0, "SEQUENCER_OT_meta_toggle");
234 layout.itemO("SEQUENCER_OT_reload")
236 layout.itemO("SEQUENCER_OT_lock")
237 layout.itemO("SEQUENCER_OT_unlock")
238 layout.itemO("SEQUENCER_OT_mute")
239 layout.itemO("SEQUENCER_OT_unmute")
241 layout.item_enumO("SEQUENCER_OT_mute", property="type", value='UNSELECTED', text="Mute Deselected Strips")
243 layout.itemO("SEQUENCER_OT_snap")
246 class SequencerButtonsPanel(bpy.types.Panel):
247 __space_type__ = "SEQUENCE_EDITOR"
248 __region_type__ = "UI"
250 def poll(self, context):
251 return context.space_data.display_mode == 'SEQUENCER' and act_strip(context) != None
253 class SequencerButtonsPanel_Output(bpy.types.Panel):
254 __space_type__ = "SEQUENCE_EDITOR"
255 __region_type__ = "UI"
257 def poll(self, context):
258 return context.space_data.display_mode != 'SEQUENCER'
260 class SEQUENCER_PT_edit(SequencerButtonsPanel):
261 __label__ = "Edit Strip"
262 __idname__ = "SEQUENCER_PT_edit"
264 def draw(self, context):
267 strip = act_strip(context)
269 layout.itemR(strip, "name")
271 layout.itemR(strip, "type")
273 layout.itemR(strip, "blend_mode")
275 layout.itemR(strip, "blend_opacity", text="Opacity", slider=True)
277 split = layout.split()
280 col.itemR(strip, "mute")
281 col.itemR(strip, "lock")
282 col.itemR(strip, "frame_locked")
285 col.itemR(strip, "channel")
286 col.itemR(strip, "start_frame")
287 col.itemR(strip, "length")
289 split = layout.split()
292 col.itemR(strip, "start_offset")
293 col.itemR(strip, "start_still")
296 col.itemR(strip, "end_offset")
297 col.itemR(strip, "end_still")
299 class SEQUENCER_PT_effect(SequencerButtonsPanel):
300 __label__ = "Effect Strip"
301 __idname__ = "SEQUENCER_PT_effect"
303 def poll(self, context):
304 if context.space_data.display_mode != 'SEQUENCER':
307 strip = act_strip(context)
311 return strip.type in ('COLOR', 'WIPE', 'GLOW', 'SPEED', 'TRANSFORM')
313 def draw(self, context):
316 strip = act_strip(context)
318 if strip.type == 'COLOR':
319 layout.itemR(strip, "color")
321 elif strip.type == 'WIPE':
323 row.itemL(text="Transition Type:")
324 row.itemL(text="Direction:")
327 row.itemR(strip, "transition_type", text="")
328 row.itemR(strip, "direction", text="")
331 row.itemR(strip, "blur_width")
332 if strip.transition_type in ('SINGLE', 'DOUBLE'):
333 row.itemR(strip, "angle")
335 elif strip.type == 'GLOW':
336 flow = layout.column_flow()
337 flow.itemR(strip, "threshold")
338 flow.itemR(strip, "clamp")
339 flow.itemR(strip, "boost_factor")
340 flow.itemR(strip, "blur_distance")
343 row.itemR(strip, "quality", slider=True)
344 row.itemR(strip, "only_boost")
346 elif strip.type == 'SPEED':
347 layout.itemR(strip, "global_speed")
349 flow = layout.column_flow()
350 flow.itemR(strip, "curve_velocity")
351 flow.itemR(strip, "curve_compress_y")
352 flow.itemR(strip, "frame_blending")
354 elif strip.type == 'TRANSFORM':
356 row.itemL(text="Interpolation:")
357 row.itemL(text="Translation Unit:")
360 row.itemR(strip, "interpolation", text="")
361 row.itemR(strip, "translation_unit", text="")
363 split = layout.split()
366 sub = col.column(align=True)
367 sub.itemL(text="Position X:")
368 sub.itemR(strip, "translate_start_x", text="Start")
369 sub.itemR(strip, "translate_end_x", text="End")
371 sub = col.column(align=True)
372 sub.itemL(text="Scale X:")
373 sub.itemR(strip, "scale_start_x", text="Start")
374 sub.itemR(strip, "scale_end_x", text="End")
376 sub = col.column(align=True)
377 sub.itemL(text="Rotation:")
378 sub.itemR(strip, "rotation_start", text="Start")
379 sub.itemR(strip, "rotation_end", text="End")
382 sub = col.column(align=True)
383 sub.itemL(text="Position Y:")
384 sub.itemR(strip, "translate_start_y", text="Start")
385 sub.itemR(strip, "translate_end_y", text="End")
387 sub = col.column(align=True)
388 sub.itemL(text="Scale Y:")
389 sub.itemR(strip, "scale_start_y", text="Start")
390 sub.itemR(strip, "scale_end_y", text="End")
392 class SEQUENCER_PT_input(SequencerButtonsPanel):
393 __label__ = "Strip Input"
394 __idname__ = "SEQUENCER_PT_input"
396 def poll(self, context):
397 if context.space_data.display_mode != 'SEQUENCER':
400 strip = act_strip(context)
404 return strip.type in ('MOVIE', 'IMAGE', 'SOUND')
406 def draw(self, context):
409 strip = act_strip(context)
411 split = layout.split(percentage=0.3)
413 sub.itemL(text="Directory:")
415 sub.itemR(strip, "directory", text="")
417 # Current element for the filename
418 split = layout.split(percentage=0.3)
420 sub.itemL(text="File Name:")
423 elem = strip.getStripElem(context.scene.current_frame)
425 sub.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
427 layout.itemR(strip, "use_translation")
429 flow = layout.column_flow()
430 flow.active = strip.use_translation
431 flow.itemR(strip.transform, "offset_x")
432 flow.itemR(strip.transform, "offset_y")
435 layout.itemR(strip, "use_crop")
437 flow = layout.column_flow()
438 flow.active = strip.use_crop
439 flow.itemR(strip.crop, "top")
440 flow.itemR(strip.crop, "left")
441 flow.itemR(strip.crop, "bottom")
442 flow.itemR(strip.crop, "right")
444 layout.itemR(strip, "animation_start_offset")
445 layout.itemR(strip, "animation_end_offset")
448 class SEQUENCER_PT_filter(SequencerButtonsPanel):
450 __idname__ = "SEQUENCER_PT_filter"
452 def poll(self, context):
453 if context.space_data.display_mode != 'SEQUENCER':
456 strip = act_strip(context)
460 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
462 def draw(self, context):
465 strip = act_strip(context)
467 split = layout.split()
470 col.itemR(strip, "premultiply")
471 col.itemR(strip, "convert_float")
472 col.itemR(strip, "de_interlace")
473 col.itemR(strip, "multiply_colors")
474 col.itemR(strip, "strobe")
477 col.itemL(text="Flip:")
478 col.itemR(strip, "flip_x", text="X")
479 col.itemR(strip, "flip_y", text="Y")
480 col.itemR(strip, "reverse_frames", text="Backwards")
482 layout.itemR(strip, "use_color_balance")
483 if strip.color_balance: # TODO - need to add this somehow
485 row.active = strip.use_color_balance
487 col.itemR(strip.color_balance, "lift")
488 col.itemR(strip.color_balance, "inverse_lift")
490 col.itemR(strip.color_balance, "gamma")
491 col.itemR(strip.color_balance, "inverse_gamma")
493 col.itemR(strip.color_balance, "gain")
494 col.itemR(strip.color_balance, "inverse_gain")
497 class SEQUENCER_PT_proxy(SequencerButtonsPanel):
499 __idname__ = "SEQUENCER_PT_proxy"
501 def poll(self, context):
502 if context.space_data.display_mode != 'SEQUENCER':
505 strip = act_strip(context)
509 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
511 def draw_header(self, context):
512 strip = act_strip(context)
516 layout.itemR(strip, "use_proxy", text="")
518 def draw(self, context):
519 strip = act_strip(context)
523 flow = layout.column_flow()
524 flow.itemR(strip, "proxy_custom_directory")
525 if strip.proxy: # TODO - need to add this somehow
526 flow.itemR(strip.proxy, "directory")
527 flow.itemR(strip.proxy, "file")
530 class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
531 __label__ = "View Settings"
532 __idname__ = "SEQUENCER_PT_view"
534 def draw(self, context):
535 st = context.space_data
539 flow = layout.column_flow()
540 flow.itemR(st, "draw_overexposed") # text="Zebra"
541 flow.itemR(st, "draw_safe_margin")
544 bpy.types.register(SEQUENCER_HT_header) # header/menu classes
545 bpy.types.register(SEQUENCER_MT_view)
546 bpy.types.register(SEQUENCER_MT_select)
547 bpy.types.register(SEQUENCER_MT_marker)
548 bpy.types.register(SEQUENCER_MT_add)
549 bpy.types.register(SEQUENCER_MT_add_effect)
550 bpy.types.register(SEQUENCER_MT_strip)
552 bpy.types.register(SEQUENCER_PT_edit) # sequencer panels
553 bpy.types.register(SEQUENCER_PT_effect)
554 bpy.types.register(SEQUENCER_PT_input)
555 bpy.types.register(SEQUENCER_PT_filter)
556 bpy.types.register(SEQUENCER_PT_proxy)
558 bpy.types.register(SEQUENCER_PT_view) # view panels