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(context)
20 if context.area.show_menus:
21 row = layout.row(align=True)
22 row.itemM(context, "SEQUENCER_MT_view")
24 row.itemR(st, "display_mode")
28 if st.display_mode == 'SEQUENCER':
29 row.itemM(context, "SEQUENCER_MT_select")
30 row.itemM(context, "SEQUENCER_MT_marker")
31 row.itemM(context, "SEQUENCER_MT_add")
32 row.itemM(context, "SEQUENCER_MT_strip")
34 row.itemO("SEQUENCER_OT_reload")
36 row.itemR(st, "display_channel") # text="Chan"
38 row.itemR(st, "draw_overexposed") # text="Zebra"
40 row.itemR(st, "draw_safe_margin")
42 class SEQUENCER_MT_view(bpy.types.Menu):
43 __space_type__ = "SEQUENCE_EDITOR"
44 __label__ = "View (TODO)"
46 def draw(self, context):
48 st = context.space_data
53 uiBlock *block= uiBeginBlock(C, ar, "seq_viewmenu", UI_EMBOSSP);
54 short yco= 0, menuwidth=120;
56 if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
57 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
58 "Play Back Animation "
59 "in all Sequence Areas|Alt A", 0, yco-=20,
60 menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
63 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL,
64 "Grease Pencil...", 0, yco-=20,
65 menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
68 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
69 "Play Back Animation "
70 "in this window|Alt A", 0, yco-=20,
71 menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
73 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
74 "Play Back Animation in all "
75 "3D Views and Sequence Areas|Alt Shift A",
77 menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
81 layout.itemO("SEQUENCER_OT_view_all")
82 layout.itemO("SEQUENCER_OT_view_selected")
88 uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
89 "Lock Time to Other Windows|", 0, yco-=20,
90 menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
92 /* Draw time or frames.*/
96 layout.itemR(st, "draw_frames")
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_movie_strip_add", text="Movie")
152 layout.item_booleanO("SEQUENCER_OT_movie_strip_add", "sound", True, text="Movie & Sound") # FFMPEG ONLY
153 layout.itemO("SEQUENCER_OT_image_strip_add", text="Image")
154 layout.itemO("SEQUENCER_OT_sound_strip_add", text="Sound (Ram)")
155 layout.item_booleanO("SEQUENCER_OT_sound_strip_add", "hd", True, text="Sound (Streaming)") # FFMPEG ONLY
157 layout.itemM(context, "SEQUENCER_MT_add_effect")
160 class SEQUENCER_MT_add_effect(bpy.types.Menu):
161 __space_type__ = "SEQUENCE_EDITOR"
162 __label__ = "Effect Strip..."
164 def draw(self, context):
166 st = context.space_data
169 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ADD')
170 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'SUBTRACT')
171 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ALPHA_OVER')
172 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'ALPHA_UNDER')
173 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'GAMMA_CROSS')
174 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'MULTIPLY')
175 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'OVER_DROP')
176 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'PLUGIN')
177 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'WIPE')
178 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'GLOW')
179 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'TRANSFORM')
180 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'COLOR')
181 self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", 'type', 'SPEED')
183 class SEQUENCER_MT_strip(bpy.types.Menu):
184 __space_type__ = "SEQUENCE_EDITOR"
187 def draw(self, context):
189 st = context.space_data
191 layout.operator_context = 'INVOKE_REGION_WIN'
194 layout.item_enumO("TFM_OT_transform", "mode", 'TRANSLATION', text="Grab/Move")
195 layout.item_enumO("TFM_OT_transform", "mode", 'TIME_EXTEND', text="Grab/Extend from frame")
196 # uiItemO(layout, NULL, 0, "SEQUENCER_OT_strip_snap"); // TODO - add this operator
199 layout.item_enumO("SEQUENCER_OT_cut", "type", 'HARD', text="Cut (hard) at frame")
200 layout.item_enumO("SEQUENCER_OT_cut", "type", 'SOFT', text="Cut (soft) at frame")
201 layout.itemO("SEQUENCER_OT_images_separate")
204 layout.itemO("SEQUENCER_OT_duplicate_add")
205 layout.itemO("SEQUENCER_OT_delete")
207 strip = act_strip(context)
214 layout.itemO("SEQUENCER_OT_effect_change")
215 layout.itemO("SEQUENCER_OT_effect_reassign_inputs")
218 layout.itemO("SEQUENCER_OT_image_change")
221 layout.itemO("SEQUENCER_OT_scene_change", text="Change Scene")
224 layout.itemO("SEQUENCER_OT_movie_change")
228 layout.itemO("SEQUENCER_OT_meta_make")
229 layout.itemO("SEQUENCER_OT_meta_separate")
231 #if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
233 # uiItemO(layout, NULL, 0, "SEQUENCER_OT_meta_toggle");
237 layout.itemO("SEQUENCER_OT_reload")
239 layout.itemO("SEQUENCER_OT_lock")
240 layout.itemO("SEQUENCER_OT_unlock")
241 layout.itemO("SEQUENCER_OT_mute")
242 layout.itemO("SEQUENCER_OT_unmute")
244 layout.item_enumO("SEQUENCER_OT_mute", property="type", value='UNSELECTED', text="Mute Deselected Strips")
249 class SequencerButtonsPanel(bpy.types.Panel):
250 __space_type__ = "SEQUENCE_EDITOR"
251 __region_type__ = "UI"
253 def poll(self, context):
254 return act_strip(context) != None
256 class SEQUENCER_PT_edit(SequencerButtonsPanel):
257 __label__ = "Edit Strip"
258 __idname__ = "SEQUENCER_PT_edit"
260 def draw(self, context):
263 strip = act_strip(context)
265 layout.itemR(strip, "name")
267 layout.itemR(strip, "blend_mode")
269 layout.itemR(strip, "blend_opacity")
272 row.itemR(strip, "mute")
273 row.itemR(strip, "lock")
274 row.itemR(strip, "frame_locked")
277 row.itemR(strip, "channel")
278 row.itemR(strip, "start_frame")
281 row.itemR(strip, "length")
282 row.itemR(strip, "type")
284 class SEQUENCER_PT_effect(SequencerButtonsPanel):
285 __label__ = "Effect Strip"
286 __idname__ = "SEQUENCER_PT_effect"
288 def poll(self, context):
289 strip = act_strip(context)
293 return strip.type in ('COLOR', 'WIPE', 'GLOW', 'SPEED', 'TRANSFORM')
295 def draw(self, context):
298 strip = act_strip(context)
300 if strip.type == 'COLOR':
301 layout.itemR(strip, "color")
303 elif strip.type == 'WIPE':
305 row.itemL(text="Transition Type:")
306 row.itemL(text="Direction:")
309 row.itemR(strip, "transition_type", text="")
310 row.itemR(strip, "direction", text="")
313 row.itemR(strip, "blur_width")
314 if strip.transition_type in ('SINGLE', 'DOUBLE'):
315 row.itemR(strip, "angle")
317 elif strip.type == 'GLOW':
318 flow = layout.column_flow()
319 flow.itemR(strip, "threshold")
320 flow.itemR(strip, "clamp")
321 flow.itemR(strip, "boost_factor")
322 flow.itemR(strip, "blur_distance")
325 row.itemR(strip, "quality", slider=True)
326 row.itemR(strip, "only_boost")
328 elif strip.type == 'SPEED':
329 layout.itemR(strip, "global_speed")
331 flow = layout.column_flow()
332 flow.itemR(strip, "curve_velocity")
333 flow.itemR(strip, "curve_compress_y")
334 flow.itemR(strip, "frame_blending")
336 elif strip.type == 'TRANSFORM':
338 row.itemL(text="Interpolation:")
339 row.itemL(text="Translation Unit:")
342 row.itemR(strip, "interpolation", text="")
343 row.itemR(strip, "translation_unit", text="")
345 split = layout.split()
348 sub = col.column(align=True)
349 sub.itemL(text="Position X:")
350 sub.itemR(strip, "translate_start_x", text="Start")
351 sub.itemR(strip, "translate_end_x", text="End")
353 sub = col.column(align=True)
354 sub.itemL(text="Scale X:")
355 sub.itemR(strip, "scale_start_x", text="Start")
356 sub.itemR(strip, "scale_end_x", text="End")
358 sub = col.column(align=True)
359 sub.itemL(text="Rotation:")
360 sub.itemR(strip, "rotation_start", text="Start")
361 sub.itemR(strip, "rotation_end", text="End")
364 sub = col.column(align=True)
365 sub.itemL(text="Position Y:")
366 sub.itemR(strip, "translate_start_y", text="Start")
367 sub.itemR(strip, "translate_end_y", text="End")
369 sub = col.column(align=True)
370 sub.itemL(text="Scale Y:")
371 sub.itemR(strip, "scale_start_y", text="Start")
372 sub.itemR(strip, "scale_end_y", text="End")
374 class SEQUENCER_PT_input(SequencerButtonsPanel):
375 __label__ = "Strip Input"
376 __idname__ = "SEQUENCER_PT_input"
378 def poll(self, context):
379 strip = act_strip(context)
383 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
385 def draw(self, context):
388 strip = act_strip(context)
390 layout.itemR(strip, "directory")
392 # TODO - get current element!
393 layout.itemR(strip.elements[0], "filename")
396 layout.itemR(strip, "use_crop")
398 flow = layout.column_flow()
399 flow.active = strip.use_crop
400 flow.itemR(strip, "top")
401 flow.itemR(strip, "left")
402 flow.itemR(strip, "bottom")
403 flow.itemR(strip, "right")
406 class SEQUENCER_PT_filter(SequencerButtonsPanel):
408 __idname__ = "SEQUENCER_PT_filter"
410 def poll(self, context):
411 strip = act_strip(context)
415 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
417 def draw(self, context):
420 strip = act_strip(context)
423 row.itemR(strip, "premultiply")
424 row.itemR(strip, "convert_float")
425 row.itemR(strip, "de_interlace")
428 row.itemR(strip, "flip_x")
429 row.itemR(strip, "flip_y")
430 row.itemR(strip, "reverse_frames")
433 row.itemR(strip, "multiply_colors")
434 row.itemR(strip, "strobe")
436 layout.itemR(strip, "use_color_balance")
438 class SEQUENCER_PT_proxy(SequencerButtonsPanel):
440 __idname__ = "SEQUENCER_PT_proxy"
442 def poll(self, context):
443 strip = act_strip(context)
447 return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
449 def draw_header(self, context):
450 strip = act_strip(context)
454 layout.itemR(strip, "use_proxy", text="")
456 def draw(self, context):
457 strip = act_strip(context)
462 row.itemR(strip, "proxy_custom_directory")
463 if strip.proxy: # TODO - need to add this somehow
464 row.itemR(strip.proxy, "dir")
465 row.itemR(strip.proxy, "file")
468 bpy.types.register(SEQUENCER_HT_header)
469 bpy.types.register(SEQUENCER_MT_view)
470 bpy.types.register(SEQUENCER_MT_select)
471 bpy.types.register(SEQUENCER_MT_marker)
472 bpy.types.register(SEQUENCER_MT_add)
473 bpy.types.register(SEQUENCER_MT_add_effect)
474 bpy.types.register(SEQUENCER_MT_strip)
476 bpy.types.register(SEQUENCER_PT_edit)
477 bpy.types.register(SEQUENCER_PT_effect)
478 bpy.types.register(SEQUENCER_PT_input)
479 bpy.types.register(SEQUENCER_PT_filter)
480 bpy.types.register(SEQUENCER_PT_proxy)