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")
93 if st.display_mode == 'IMAGE':
94 layout.itemR(st, "draw_safe_margin")
95 if st.display_mode == 'WAVEFORM':
96 layout.itemR(st, "seperate_color_preview")
99 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, "");
100 else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
104 class SEQUENCER_MT_select(bpy.types.Menu):
105 __space_type__ = "SEQUENCE_EDITOR"
108 def draw(self, context):
110 st = context.space_data
113 layout.item_enumO("SEQUENCER_OT_select_active_side", "side", 'LEFT', text="Strips to the Left")
114 layout.item_enumO("SEQUENCER_OT_select_active_side", "side", 'RIGHT', text="Strips to the Right")
116 layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'BOTH', text="Surrounding Handles")
117 layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'LEFT', text="Left Handle")
118 layout.item_enumO("SEQUENCER_OT_select_handles", "side", 'RIGHT', text="Right Handle")
120 layout.itemO("SEQUENCER_OT_select_linked")
121 layout.itemO("SEQUENCER_OT_select_all_toggle")
122 layout.itemO("SEQUENCER_OT_select_invert")
124 class SEQUENCER_MT_marker(bpy.types.Menu):
125 __space_type__ = "SEQUENCE_EDITOR"
126 __label__ = "Marker (TODO)"
128 def draw(self, context):
130 st = context.space_data
133 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Add Marker|Ctrl Alt M")
134 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Duplicate Marker|Ctrl Shift D")
135 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Delete Marker|Shift X")
137 layout.itemO("SEQUENCER_OT_sound_strip_add", text="(Re)Name Marker|Ctrl M")
138 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Grab/Move Marker|Ctrl G")
140 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
142 class SEQUENCER_MT_add(bpy.types.Menu):
143 __space_type__ = "SEQUENCE_EDITOR"
146 def draw(self, context):
148 st = context.space_data
151 layout.itemO("SEQUENCER_OT_scene_strip_add", text="Scene")
152 layout.itemO("SEQUENCER_OT_movie_strip_add", text="Movie")
153 layout.item_booleanO("SEQUENCER_OT_movie_strip_add", "sound", True, text="Movie & Sound") # FFMPEG ONLY
154 layout.itemO("SEQUENCER_OT_image_strip_add", text="Image")
155 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Sound (Ram)")
156 layout.item_booleanO("SEQUENCER_OT_sound_strip_add", "hd", True, text="Sound (Streaming)") # FFMPEG ONLY
158 layout.itemM("SEQUENCER_MT_add_effect")
161 class SEQUENCER_MT_add_effect(bpy.types.Menu):
162 __space_type__ = "SEQUENCE_EDITOR"
163 __label__ = "Effect Strip..."
165 def draw(self, context):
167 st = context.space_data
170 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ADD')
171 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'SUBTRACT')
172 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ALPHA_OVER')
173 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ALPHA_UNDER')
174 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'GAMMA_CROSS')
175 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'MULTIPLY')
176 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'OVER_DROP')
177 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'PLUGIN')
178 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'WIPE')
179 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'GLOW')
180 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'TRANSFORM')
181 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'COLOR')
182 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'SPEED')
184 class SEQUENCER_MT_strip(bpy.types.Menu):
185 __space_type__ = "SEQUENCE_EDITOR"
188 def draw(self, context):
190 st = context.space_data
192 layout.operator_context = 'INVOKE_REGION_WIN'
195 layout.item_enumO("TFM_OT_transform", "mode", 'TRANSLATION', text="Grab/Move")
196 layout.item_enumO("TFM_OT_transform", "mode", 'TIME_EXTEND', text="Grab/Extend from frame")
197 # uiItemO(layout, NULL, 0, "SEQUENCER_OT_strip_snap"); // TODO - add this operator
200 layout.item_enumO("SEQUENCER_OT_cut", "type", 'HARD', text="Cut (hard) at frame")
201 layout.item_enumO("SEQUENCER_OT_cut", "type", 'SOFT', text="Cut (soft) at frame")
202 layout.itemO("SEQUENCER_OT_images_separate")
205 layout.itemO("SEQUENCER_OT_duplicate_add")
206 layout.itemO("SEQUENCER_OT_delete")
208 strip = act_strip(context)
215 layout.itemO("SEQUENCER_OT_effect_change")
216 layout.itemO("SEQUENCER_OT_effect_reassign_inputs")
219 layout.itemO("SEQUENCER_OT_image_change")
222 layout.itemO("SEQUENCER_OT_scene_change", text="Change Scene")
225 layout.itemO("SEQUENCER_OT_movie_change")
229 layout.itemO("SEQUENCER_OT_meta_make")
230 layout.itemO("SEQUENCER_OT_meta_separate")
232 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
234 # uiItemO(layout, NULL, 0, "SEQUENCER_OT_meta_toggle");
238 layout.itemO("SEQUENCER_OT_reload")
240 layout.itemO("SEQUENCER_OT_lock")
241 layout.itemO("SEQUENCER_OT_unlock")
242 layout.itemO("SEQUENCER_OT_mute")
243 layout.itemO("SEQUENCER_OT_unmute")
245 layout.item_enumO("SEQUENCER_OT_mute", property="type", value='UNSELECTED', text="Mute Deselected Strips")
247 layout.itemO("SEQUENCER_OT_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"
266 __idname__ = "SEQUENCER_PT_edit"
268 def draw(self, context):
271 strip = act_strip(context)
273 layout.itemR(strip, "name")
275 layout.itemR(strip, "type")
277 layout.itemR(strip, "blend_mode")
279 layout.itemR(strip, "blend_opacity", text="Opacity", slider=True)
281 split = layout.split()
284 col.itemR(strip, "mute")
285 col.itemR(strip, "lock")
286 col.itemR(strip, "frame_locked")
289 col.itemR(strip, "channel")
290 col.itemR(strip, "start_frame")
291 col.itemR(strip, "length")
293 split = layout.split()
296 col.itemR(strip, "start_offset")
297 col.itemR(strip, "start_still")
300 col.itemR(strip, "end_offset")
301 col.itemR(strip, "end_still")
303 class SEQUENCER_PT_effect(SequencerButtonsPanel):
304 __label__ = "Effect Strip"
305 __idname__ = "SEQUENCER_PT_effect"
307 def poll(self, context):
308 if context.space_data.display_mode != 'SEQUENCER':
311 strip = act_strip(context)
315 return strip.type in ('COLOR', 'WIPE', 'GLOW', 'SPEED', 'TRANSFORM')
317 def draw(self, context):
320 strip = act_strip(context)
322 if strip.type == 'COLOR':
323 layout.itemR(strip, "color")
325 elif strip.type == 'WIPE':
327 row.itemL(text="Transition Type:")
328 row.itemL(text="Direction:")
331 row.itemR(strip, "transition_type", text="")
332 row.itemR(strip, "direction", text="")
335 row.itemR(strip, "blur_width")
336 if strip.transition_type in ('SINGLE', 'DOUBLE'):
337 row.itemR(strip, "angle")
339 elif strip.type == 'GLOW':
340 flow = layout.column_flow()
341 flow.itemR(strip, "threshold")
342 flow.itemR(strip, "clamp")
343 flow.itemR(strip, "boost_factor")
344 flow.itemR(strip, "blur_distance")
347 row.itemR(strip, "quality", slider=True)
348 row.itemR(strip, "only_boost")
350 elif strip.type == 'SPEED':
351 layout.itemR(strip, "global_speed")
353 flow = layout.column_flow()
354 flow.itemR(strip, "curve_velocity")
355 flow.itemR(strip, "curve_compress_y")
356 flow.itemR(strip, "frame_blending")
358 elif strip.type == 'TRANSFORM':
360 row.itemL(text="Interpolation:")
361 row.itemL(text="Translation Unit:")
364 row.itemR(strip, "interpolation", text="")
365 row.itemR(strip, "translation_unit", text="")
367 split = layout.split()
370 sub = col.column(align=True)
371 sub.itemL(text="Position X:")
372 sub.itemR(strip, "translate_start_x", text="Start")
373 sub.itemR(strip, "translate_end_x", text="End")
375 sub = col.column(align=True)
376 sub.itemL(text="Scale X:")
377 sub.itemR(strip, "scale_start_x", text="Start")
378 sub.itemR(strip, "scale_end_x", text="End")
380 sub = col.column(align=True)
381 sub.itemL(text="Rotation:")
382 sub.itemR(strip, "rotation_start", text="Start")
383 sub.itemR(strip, "rotation_end", text="End")
386 sub = col.column(align=True)
387 sub.itemL(text="Position Y:")
388 sub.itemR(strip, "translate_start_y", text="Start")
389 sub.itemR(strip, "translate_end_y", text="End")
391 sub = col.column(align=True)
392 sub.itemL(text="Scale Y:")
393 sub.itemR(strip, "scale_start_y", text="Start")
394 sub.itemR(strip, "scale_end_y", text="End")
396 class SEQUENCER_PT_input(SequencerButtonsPanel):
397 __label__ = "Strip Input"
398 __idname__ = "SEQUENCER_PT_input"
400 def poll(self, context):
401 if context.space_data.display_mode != 'SEQUENCER':
404 strip = act_strip(context)
408 return strip.type in ('MOVIE', 'IMAGE', 'SOUND')
410 def draw(self, context):
413 strip = act_strip(context)
415 split = layout.split(percentage=0.3)
417 sub.itemL(text="Directory:")
419 sub.itemR(strip, "directory", text="")
421 # Current element for the filename
422 split = layout.split(percentage=0.3)
424 sub.itemL(text="File Name:")
427 elem = strip.getStripElem(context.scene.current_frame)
429 sub.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
431 layout.itemR(strip, "use_translation")
433 flow = layout.column_flow()
434 flow.active = strip.use_translation
435 flow.itemR(strip.transform, "offset_x")
436 flow.itemR(strip.transform, "offset_y")
439 layout.itemR(strip, "use_crop")
441 flow = layout.column_flow()
442 flow.active = strip.use_crop
443 flow.itemR(strip.crop, "top")
444 flow.itemR(strip.crop, "left")
445 flow.itemR(strip.crop, "bottom")
446 flow.itemR(strip.crop, "right")
448 layout.itemR(strip, "animation_start_offset")
449 layout.itemR(strip, "animation_end_offset")
452 class SEQUENCER_PT_filter(SequencerButtonsPanel):
454 __idname__ = "SEQUENCER_PT_filter"
456 def poll(self, context):
457 if context.space_data.display_mode != 'SEQUENCER':
460 strip = act_strip(context)
464 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
466 def draw(self, context):
469 strip = act_strip(context)
471 split = layout.split()
474 col.itemR(strip, "premultiply")
475 col.itemR(strip, "convert_float")
476 col.itemR(strip, "de_interlace")
477 col.itemR(strip, "multiply_colors")
478 col.itemR(strip, "strobe")
481 col.itemL(text="Flip:")
482 col.itemR(strip, "flip_x", text="X")
483 col.itemR(strip, "flip_y", text="Y")
484 col.itemR(strip, "reverse_frames", text="Backwards")
486 layout.itemR(strip, "use_color_balance")
487 if strip.color_balance: # TODO - need to add this somehow
489 row.active = strip.use_color_balance
491 col.itemR(strip.color_balance, "lift")
492 col.itemR(strip.color_balance, "inverse_lift")
494 col.itemR(strip.color_balance, "gamma")
495 col.itemR(strip.color_balance, "inverse_gamma")
497 col.itemR(strip.color_balance, "gain")
498 col.itemR(strip.color_balance, "inverse_gain")
501 class SEQUENCER_PT_proxy(SequencerButtonsPanel):
503 __idname__ = "SEQUENCER_PT_proxy"
505 def poll(self, context):
506 if context.space_data.display_mode != 'SEQUENCER':
509 strip = act_strip(context)
513 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
515 def draw_header(self, context):
516 strip = act_strip(context)
520 layout.itemR(strip, "use_proxy", text="")
522 def draw(self, context):
523 strip = act_strip(context)
527 flow = layout.column_flow()
528 flow.itemR(strip, "proxy_custom_directory")
529 if strip.proxy: # TODO - need to add this somehow
530 flow.itemR(strip.proxy, "directory")
531 flow.itemR(strip.proxy, "file")
534 class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
535 __label__ = "View Settings"
536 __idname__ = "SEQUENCER_PT_view"
538 def draw(self, context):
539 st = context.space_data
543 flow = layout.column_flow()
544 flow.itemR(st, "draw_overexposed") # text="Zebra"
545 flow.itemR(st, "draw_safe_margin")
548 bpy.types.register(SEQUENCER_HT_header) # header/menu classes
549 bpy.types.register(SEQUENCER_MT_view)
550 bpy.types.register(SEQUENCER_MT_select)
551 bpy.types.register(SEQUENCER_MT_marker)
552 bpy.types.register(SEQUENCER_MT_add)
553 bpy.types.register(SEQUENCER_MT_add_effect)
554 bpy.types.register(SEQUENCER_MT_strip)
556 bpy.types.register(SEQUENCER_PT_edit) # sequencer panels
557 bpy.types.register(SEQUENCER_PT_effect)
558 bpy.types.register(SEQUENCER_PT_input)
559 bpy.types.register(SEQUENCER_PT_filter)
560 bpy.types.register(SEQUENCER_PT_proxy)
562 bpy.types.register(SEQUENCER_PT_view) # view panels