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'
12 def draw(self, context):
15 st = context.space_data
17 row = layout.row(align=True)
20 if context.area.show_menus:
21 sub = row.row(align=True)
22 sub.itemM("SEQUENCER_MT_view")
26 if st.display_mode == 'SEQUENCER':
27 sub.itemM("SEQUENCER_MT_select")
28 sub.itemM("SEQUENCER_MT_marker")
29 sub.itemM("SEQUENCER_MT_add")
30 sub.itemM("SEQUENCER_MT_strip")
32 layout.itemR(st, "display_mode", text="")
34 if st.display_mode == 'SEQUENCER':
36 layout.itemO("sequencer.reload")
38 layout.itemR(st, "display_channel", text="Channel")
40 class SEQUENCER_MT_view(bpy.types.Menu):
43 def draw(self, context):
46 st = context.space_data
51 uiBlock *block= uiBeginBlock(C, ar, "seq_viewmenu", UI_EMBOSSP);
52 short yco= 0, menuwidth=120;
54 if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
55 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
56 "Play Back Animation "
57 "in all Sequence Areas|Alt A", 0, yco-=20,
58 menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
61 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL,
62 "Grease Pencil...", 0, yco-=20,
63 menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
66 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
67 "Play Back Animation "
68 "in this window|Alt A", 0, yco-=20,
69 menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
71 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
72 "Play Back Animation in all "
73 "3D Views and Sequence Areas|Alt Shift A",
75 menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
79 layout.itemO("sequencer.view_all")
80 layout.itemO("sequencer.view_selected")
82 layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
87 uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
88 "Lock Time to Other Windows|", 0, yco-=20,
89 menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
91 /* Draw time or frames.*/
95 layout.itemR(st, "draw_frames")
96 if st.display_mode == 'IMAGE':
97 layout.itemR(st, "draw_safe_margin")
98 if st.display_mode == 'WAVEFORM':
99 layout.itemR(st, "seperate_color_preview")
102 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, "");
103 else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
107 class SEQUENCER_MT_select(bpy.types.Menu):
110 def draw(self, context):
113 st = context.space_data
116 layout.item_enumO("sequencer.select_active_side", "side", 'LEFT', text="Strips to the Left")
117 layout.item_enumO("sequencer.select_active_side", "side", 'RIGHT', text="Strips to the Right")
119 layout.item_enumO("sequencer.select_handles", "side", 'BOTH', text="Surrounding Handles")
120 layout.item_enumO("sequencer.select_handles", "side", 'LEFT', text="Left Handle")
121 layout.item_enumO("sequencer.select_handles", "side", 'RIGHT', text="Right Handle")
123 layout.itemO("sequencer.select_linked")
124 layout.itemO("sequencer.select_all_toggle")
125 layout.itemO("sequencer.select_inverse")
127 class SEQUENCER_MT_marker(bpy.types.Menu):
128 __label__ = "Marker (TODO)"
130 def draw(self, context):
133 st = context.space_data
136 layout.itemO("marker.add", text="Add Marker")
137 layout.itemO("marker.duplicate", text="Duplicate Marker")
138 layout.itemO("marker.move", text="Grab/Move Marker")
139 layout.itemO("marker.delete", text="Delete Marker")
141 layout.itemL(text="ToDo: Name Marker")
143 #layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
145 class SEQUENCER_MT_add(bpy.types.Menu):
148 def draw(self, context):
151 st = context.space_data
154 layout.itemO("sequencer.scene_strip_add", text="Scene")
155 layout.itemO("sequencer.movie_strip_add", text="Movie")
156 layout.itemO("sequencer.image_strip_add", text="Image")
157 layout.itemO("sequencer.sound_strip_add", text="Sound")
159 layout.itemM("SEQUENCER_MT_add_effect")
161 class SEQUENCER_MT_add_effect(bpy.types.Menu):
162 __label__ = "Effect Strip..."
164 def draw(self, context):
167 st = context.space_data
170 layout.item_enumO("sequencer.effect_strip_add", 'type', 'ADD')
171 layout.item_enumO("sequencer.effect_strip_add", 'type', 'SUBTRACT')
172 layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_OVER')
173 layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_UNDER')
174 layout.item_enumO("sequencer.effect_strip_add", 'type', 'GAMMA_CROSS')
175 layout.item_enumO("sequencer.effect_strip_add", 'type', 'MULTIPLY')
176 layout.item_enumO("sequencer.effect_strip_add", 'type', 'OVER_DROP')
177 layout.item_enumO("sequencer.effect_strip_add", 'type', 'PLUGIN')
178 layout.item_enumO("sequencer.effect_strip_add", 'type', 'WIPE')
179 layout.item_enumO("sequencer.effect_strip_add", 'type', 'GLOW')
180 layout.item_enumO("sequencer.effect_strip_add", 'type', 'TRANSFORM')
181 layout.item_enumO("sequencer.effect_strip_add", 'type', 'COLOR')
182 layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED')
184 class SEQUENCER_MT_strip(bpy.types.Menu):
187 def draw(self, context):
190 st = context.space_data
192 layout.operator_context = 'INVOKE_REGION_WIN'
195 layout.item_enumO("tfm.transform", "mode", 'TRANSLATION', text="Grab/Move")
196 layout.item_enumO("tfm.transform", "mode", 'TIME_EXTEND', text="Grab/Extend from frame")
197 # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
200 layout.item_enumO("sequencer.cut", "type", 'HARD', text="Cut (hard) at frame")
201 layout.item_enumO("sequencer.cut", "type", 'SOFT', text="Cut (soft) at frame")
202 layout.itemO("sequencer.images_separate")
205 layout.itemO("sequencer.duplicate")
206 layout.itemO("sequencer.delete")
208 strip = act_strip(context)
215 layout.itemO("sequencer.effect_change")
216 layout.itemO("sequencer.effect_reassign_inputs")
219 layout.itemO("sequencer.image_change")
222 layout.itemO("sequencer.scene_change", text="Change Scene")
225 layout.itemO("sequencer.movie_change")
229 layout.itemO("sequencer.meta_make")
230 layout.itemO("sequencer.meta_separate")
232 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
234 # uiItemO(layout, NULL, 0, "sequencer.meta_toggle");
238 layout.itemO("sequencer.reload")
240 layout.itemO("sequencer.lock")
241 layout.itemO("sequencer.unlock")
242 layout.itemO("sequencer.mute")
243 layout.itemO("sequencer.unmute")
245 layout.item_booleanO("sequencer.mute", "unselected", 1, text="Mute Deselected Strips")
247 layout.itemO("sequencer.snap")
250 class SequencerButtonsPanel(bpy.types.Panel):
251 __space_type__ = 'SEQUENCE_EDITOR'
252 __region_type__ = 'UI'
254 def poll(self, context):
255 return context.space_data.display_mode == 'SEQUENCER' and act_strip(context) != None
257 class SequencerButtonsPanel_Output(bpy.types.Panel):
258 __space_type__ = 'SEQUENCE_EDITOR'
259 __region_type__ = 'UI'
261 def poll(self, context):
262 return context.space_data.display_mode != 'SEQUENCER'
264 class SEQUENCER_PT_edit(SequencerButtonsPanel):
265 __label__ = "Edit Strip"
267 def draw(self, context):
270 strip = act_strip(context)
272 split = layout.split(percentage=0.3)
273 split.itemL(text="Name:")
274 split.itemR(strip, "name", text="")
276 split = layout.split(percentage=0.3)
277 split.itemL(text="Type:")
278 split.itemR(strip, "type", text="")
280 split = layout.split(percentage=0.3)
281 split.itemL(text="Blend:")
282 split.itemR(strip, "blend_mode", text="")
285 if strip.mute == True:
286 row.itemR(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_ON', text="")
287 elif strip.mute == False:
288 row.itemR(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_OFF', text="")
291 sub.active = (not strip.mute)
293 sub.itemR(strip, "blend_opacity", text="Opacity", slider=True)
296 row.itemR(strip, "lock")
297 row.itemR(strip, "frame_locked", text="Frame Lock")
299 col = layout.column()
300 col.enabled = not strip.lock
301 col.itemR(strip, "channel")
302 col.itemR(strip, "start_frame")
303 col.itemR(strip, "length")
305 col = layout.column(align=True)
306 col.itemL(text="Offset:")
307 col.itemR(strip, "start_offset", text="Start")
308 col.itemR(strip, "end_offset", text="End")
310 col = layout.column(align=True)
311 col.itemL(text="Still:")
312 col.itemR(strip, "start_still", text="Start")
313 col.itemR(strip, "end_still", text="End")
315 class SEQUENCER_PT_effect(SequencerButtonsPanel):
316 __label__ = "Effect Strip"
318 def poll(self, context):
319 if context.space_data.display_mode != 'SEQUENCER':
322 strip = act_strip(context)
326 return strip.type in ('COLOR', 'WIPE', 'GLOW', 'SPEED', 'TRANSFORM')
328 def draw(self, context):
331 strip = act_strip(context)
333 if strip.type == 'COLOR':
334 layout.itemR(strip, "color")
336 elif strip.type == 'WIPE':
338 col = layout.column()
339 col.itemR(strip, "transition_type")
340 col.itemL(text="Direction:")
341 col.row().itemR(strip, "direction", expand=True)
343 col = layout.column()
344 col.itemR(strip, "blur_width", slider=True)
345 if strip.transition_type in ('SINGLE', 'DOUBLE'):
346 col.itemR(strip, "angle")
348 elif strip.type == 'GLOW':
349 flow = layout.column_flow()
350 flow.itemR(strip, "threshold", slider=True)
351 flow.itemR(strip, "clamp", slider=True)
352 flow.itemR(strip, "boost_factor")
353 flow.itemR(strip, "blur_distance")
356 row.itemR(strip, "quality", slider=True)
357 row.itemR(strip, "only_boost")
359 elif strip.type == 'SPEED':
360 layout.itemR(strip, "global_speed")
362 flow = layout.column_flow()
363 flow.itemR(strip, "curve_velocity")
364 flow.itemR(strip, "curve_compress_y")
365 flow.itemR(strip, "frame_blending")
367 elif strip.type == 'TRANSFORM':
369 col = layout.column()
370 col.itemR(strip, "interpolation")
371 col.itemR(strip, "translation_unit")
373 col = layout.column(align=True)
374 col.itemL(text="Position X:")
375 col.itemR(strip, "translate_start_x", text="Start")
376 col.itemR(strip, "translate_end_x", text="End")
378 col = layout.column(align=True)
379 col.itemL(text="Position Y:")
380 col.itemR(strip, "translate_start_y", text="Start")
381 col.itemR(strip, "translate_end_y", text="End")
385 col = layout.column(align=True)
386 col.itemL(text="Scale X:")
387 col.itemR(strip, "scale_start_x", text="Start")
388 col.itemR(strip, "scale_end_x", text="End")
390 col = layout.column(align=True)
391 col.itemL(text="Scale Y:")
392 col.itemR(strip, "scale_start_y", text="Start")
393 col.itemR(strip, "scale_end_y", text="End")
397 col = layout.column(align=True)
398 col.itemL(text="Rotation:")
399 col.itemR(strip, "rotation_start", text="Start")
400 col.itemR(strip, "rotation_end", text="End")
402 class SEQUENCER_PT_input(SequencerButtonsPanel):
403 __label__ = "Strip Input"
405 def poll(self, context):
406 if context.space_data.display_mode != 'SEQUENCER':
409 strip = act_strip(context)
413 return strip.type in ('MOVIE', 'IMAGE')
415 def draw(self, context):
418 strip = act_strip(context)
420 split = layout.split(percentage=0.2)
422 col.itemL(text="Path:")
424 col.itemR(strip, "directory", text="")
426 # Current element for the filename
429 elem = strip.getStripElem(context.scene.current_frame)
431 split = layout.split(percentage=0.2)
433 col.itemL(text="File:")
435 col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
437 layout.itemR(strip, "use_translation", text="Image Offset:")
439 col = layout.column(align=True)
440 col.active = strip.use_translation
441 col.itemR(strip.transform, "offset_x", text="X")
442 col.itemR(strip.transform, "offset_y", text="Y")
444 layout.itemR(strip, "use_crop", text="Image Crop:")
446 col = layout.column(align=True)
447 col.active = strip.use_crop
448 col.itemR(strip.crop, "top")
449 col.itemR(strip.crop, "left")
450 col.itemR(strip.crop, "bottom")
451 col.itemR(strip.crop, "right")
453 col = layout.column(align=True)
454 col.itemL(text="Trim Duration:")
455 col.itemR(strip, "animation_start_offset", text="Start")
456 col.itemR(strip, "animation_end_offset", text="End")
458 class SEQUENCER_PT_sound(SequencerButtonsPanel):
461 def poll(self, context):
462 if context.space_data.display_mode != 'SEQUENCER':
465 strip = act_strip(context)
469 return strip.type in ('SOUND', )
471 def draw(self, context):
474 strip = act_strip(context)
476 layout.template_ID(strip, "sound", new="sound.open")
479 layout.itemR(strip.sound, "filename", text="")
482 if strip.sound.packed_file:
483 row.itemO("sound.unpack", icon='ICON_PACKAGE', text="Unpack")
485 row.itemO("sound.pack", icon='ICON_UGLYPACKAGE', text="Pack")
487 row.itemR(strip.sound, "caching")
489 class SEQUENCER_PT_filter(SequencerButtonsPanel):
492 def poll(self, context):
493 if context.space_data.display_mode != 'SEQUENCER':
496 strip = act_strip(context)
500 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
502 def draw(self, context):
505 strip = act_strip(context)
507 col = layout.column()
508 col.itemL(text="Video:")
509 col.itemR(strip, "strobe")
510 col.itemR(strip, "de_interlace")
512 col = layout.column()
513 col.itemL(text="Colors:")
514 col.itemR(strip, "multiply_colors", text="Multiply")
515 col.itemR(strip, "premultiply")
516 col.itemR(strip, "convert_float")
518 col = layout.column()
519 col.itemL(text="Flip:")
520 col.itemR(strip, "flip_x", text="X")
521 col.itemR(strip, "flip_y", text="Y")
522 col.itemR(strip, "reverse_frames", text="Backwards")
524 layout.itemR(strip, "use_color_balance")
525 if strip.color_balance: # TODO - need to add this somehow
527 row.active = strip.use_color_balance
529 col.itemR(strip.color_balance, "lift")
530 col.itemR(strip.color_balance, "inverse_lift", text="Inverse")
532 col.itemR(strip.color_balance, "gamma")
533 col.itemR(strip.color_balance, "inverse_gamma", text="Inverse")
535 col.itemR(strip.color_balance, "gain")
536 col.itemR(strip.color_balance, "inverse_gain", text="Inverse")
538 class SEQUENCER_PT_proxy(SequencerButtonsPanel):
541 def poll(self, context):
542 if context.space_data.display_mode != 'SEQUENCER':
545 strip = act_strip(context)
549 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
551 def draw_header(self, context):
552 strip = act_strip(context)
554 self.layout.itemR(strip, "use_proxy", text="")
556 def draw(self, context):
559 strip = act_strip(context)
561 flow = layout.column_flow()
562 flow.itemR(strip, "proxy_custom_directory")
563 if strip.proxy: # TODO - need to add this somehow
564 flow.itemR(strip.proxy, "directory")
565 flow.itemR(strip.proxy, "file")
567 class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
568 __label__ = "View Settings"
570 def draw(self, context):
573 st = context.space_data
575 col = layout.column()
576 col.itemR(st, "draw_overexposed") # text="Zebra"
577 col.itemR(st, "draw_safe_margin")
579 bpy.types.register(SEQUENCER_HT_header) # header/menu classes
580 bpy.types.register(SEQUENCER_MT_view)
581 bpy.types.register(SEQUENCER_MT_select)
582 bpy.types.register(SEQUENCER_MT_marker)
583 bpy.types.register(SEQUENCER_MT_add)
584 bpy.types.register(SEQUENCER_MT_add_effect)
585 bpy.types.register(SEQUENCER_MT_strip)
587 bpy.types.register(SEQUENCER_PT_edit) # sequencer panels
588 bpy.types.register(SEQUENCER_PT_effect)
589 bpy.types.register(SEQUENCER_PT_input)
590 bpy.types.register(SEQUENCER_PT_sound)
591 bpy.types.register(SEQUENCER_PT_filter)
592 bpy.types.register(SEQUENCER_PT_proxy)
594 bpy.types.register(SEQUENCER_PT_view) # view panels