Update build files to use new OpenAL libraries
[blender.git] / release / scripts / startup / bl_ui / space_clip.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
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.
7 #
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.
12 #
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.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21 from bpy.types import Panel, Header, Menu
22
23
24 class CLIP_HT_header(Header):
25     bl_space_type = 'CLIP_EDITOR'
26
27     def draw(self, context):
28         layout = self.layout
29
30         sc = context.space_data
31         clip = sc.clip
32
33         row = layout.row(align=True)
34         row.template_header()
35
36         if context.area.show_menus:
37             sub = row.row(align=True)
38             sub.menu("CLIP_MT_view")
39
40             if clip:
41                 sub.menu("CLIP_MT_select")
42
43             sub.menu("CLIP_MT_clip")
44
45             if clip:
46                 sub.menu("CLIP_MT_track")
47                 sub.menu("CLIP_MT_reconstruction")
48
49         if clip:
50             layout.prop(sc, "mode", text="")
51             layout.prop(sc, "view", text="", expand=True)
52
53             if sc.view == 'GRAPH':
54                 row = layout.row(align=True)
55
56                 if sc.show_filters:
57                     row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_DOWN',
58                         text="Filters")
59
60                     sub = row.column()
61                     sub.active = clip.tracking.reconstruction.is_valid
62                     sub.prop(sc, "show_graph_frames", icon='SEQUENCE', text="")
63
64                     row.prop(sc, "show_graph_tracks", icon='ANIM', text="")
65                 else:
66                     row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_RIGHT',
67                         text="Filters")
68
69         row = layout.row()
70         row.template_ID(sc, "clip", open='clip.open')
71
72         if clip:
73             r = clip.tracking.reconstruction
74
75             if r.is_valid:
76                 layout.label(text="Average solve error: %.4f" %
77                     (r.average_error))
78
79         layout.template_running_jobs()
80
81
82 class CLIP_PT_tools_marker(Panel):
83     bl_space_type = 'CLIP_EDITOR'
84     bl_region_type = 'TOOLS'
85     bl_label = "Marker"
86
87     @classmethod
88     def poll(cls, context):
89         sc = context.space_data
90         clip = sc.clip
91
92         return clip and sc.mode == 'TRACKING'
93
94     def draw(self, context):
95         sc = context.space_data
96         clip = sc.clip
97         settings = clip.tracking.settings
98         layout = self.layout
99
100         col = layout.column(align=True)
101         col.operator("clip.add_marker_move")
102         col.operator("clip.detect_features")
103         col.operator("clip.delete_track")
104
105         box = layout.box()
106         row = box.row(align=True)
107         row.prop(settings, "show_default_expanded", text="", emboss=False)
108         row.label(text="Tracking Settings")
109
110         if settings.show_default_expanded:
111             col = box.column()
112             row = col.row(align=True)
113             label = bpy.types.CLIP_MT_tracking_settings_presets.bl_label
114             row.menu('CLIP_MT_tracking_settings_presets', text=label)
115             row.operator("clip.tracking_settings_preset_add",
116                          text="", icon='ZOOMIN')
117             props = row.operator("clip.tracking_settings_preset_add",
118                                  text="", icon='ZOOMOUT')
119             props.remove_active = True
120
121             col.separator()
122
123             sub = col.column(align=True)
124             sub.prop(settings, "default_pattern_size")
125             sub.prop(settings, "default_search_size")
126
127             col.label(text="Tracker:")
128             col.prop(settings, "default_tracker", text="")
129
130             if settings.default_tracker == 'KLT':
131                 col.prop(settings, "default_pyramid_levels")
132             col.prop(settings, "default_correlation_min")
133
134             col.separator()
135
136             sub = col.column(align=True)
137             sub.prop(settings, "default_frames_limit")
138             sub.prop(settings, "default_margin")
139
140             col.label(text="Match:")
141             col.prop(settings, "default_pattern_match", text="")
142
143
144 class CLIP_PT_tools_tracking(Panel):
145     bl_space_type = 'CLIP_EDITOR'
146     bl_region_type = 'TOOLS'
147     bl_label = "Track"
148
149     @classmethod
150     def poll(cls, context):
151         sc = context.space_data
152         clip = sc.clip
153
154         return clip and sc.mode == 'TRACKING'
155
156     def draw(self, context):
157         layout = self.layout
158         # clip = context.space_data.clip  # UNUSED
159
160         row = layout.row(align=True)
161
162         props = row.operator("clip.track_markers", text="", icon='FRAME_PREV')
163         props.backwards = True
164         props = row.operator("clip.track_markers", text="",
165              icon='PLAY_REVERSE')
166         props.backwards = True
167         props.sequence = True
168         props = row.operator("clip.track_markers", text="", icon='PLAY')
169         props.sequence = True
170         row.operator("clip.track_markers", text="", icon='FRAME_NEXT')
171
172         col = layout.column(align=True)
173         props = col.operator("clip.clear_track_path", text="Clear After")
174         props.action = 'REMAINED'
175
176         props = col.operator("clip.clear_track_path", text="Clear Before")
177         props.action = 'UPTO'
178
179         props = col.operator("clip.clear_track_path", text="Clear")
180         props.action = 'ALL'
181
182         layout.operator("clip.join_tracks", text="Join")
183
184
185 class CLIP_PT_tools_solve(Panel):
186     bl_space_type = 'CLIP_EDITOR'
187     bl_region_type = 'TOOLS'
188     bl_label = "Solve"
189
190     @classmethod
191     def poll(cls, context):
192         sc = context.space_data
193         clip = sc.clip
194
195         return clip and sc.mode == 'TRACKING'
196
197     def draw(self, context):
198         layout = self.layout
199         clip = context.space_data.clip
200         settings = clip.tracking.settings
201
202         col = layout.column(align=True)
203         col.operator("clip.solve_camera", text="Camera Motion")
204         col.operator("clip.clear_solution")
205
206         col = layout.column(align=True)
207         col.prop(settings, "keyframe_a")
208         col.prop(settings, "keyframe_b")
209
210         col = layout.column(align=True)
211         col.label(text="Refine:")
212         col.prop(settings, "refine_intrinsics", text="")
213
214
215 class CLIP_PT_tools_cleanup(Panel):
216     bl_space_type = 'CLIP_EDITOR'
217     bl_region_type = 'TOOLS'
218     bl_label = "Clean up"
219
220     @classmethod
221     def poll(cls, context):
222         sc = context.space_data
223         clip = sc.clip
224
225         return clip and sc.mode == 'TRACKING'
226
227     def draw(self, context):
228         layout = self.layout
229         clip = context.space_data.clip
230         settings = clip.tracking.settings
231
232         layout.operator("clip.clean_tracks")
233
234         layout.prop(settings, 'clean_frames', text="Frames")
235         layout.prop(settings, 'clean_error', text="Error")
236         layout.prop(settings, 'clean_action', text="")
237
238
239 class CLIP_PT_tools_geometry(Panel):
240     bl_space_type = 'CLIP_EDITOR'
241     bl_region_type = 'TOOLS'
242     bl_label = "Geometry"
243
244     @classmethod
245     def poll(cls, context):
246         sc = context.space_data
247         clip = sc.clip
248
249         return clip and sc.mode == 'RECONSTRUCTION'
250
251     def draw(self, context):
252         layout = self.layout
253
254         layout.operator("clip.bundles_to_mesh")
255         layout.operator("clip.track_to_empty")
256
257
258 class CLIP_PT_tools_orientation(Panel):
259     bl_space_type = 'CLIP_EDITOR'
260     bl_region_type = 'TOOLS'
261     bl_label = "Orientation"
262
263     @classmethod
264     def poll(cls, context):
265         sc = context.space_data
266         clip = sc.clip
267
268         return clip and sc.mode == 'RECONSTRUCTION'
269
270     def draw(self, context):
271         sc = context.space_data
272         layout = self.layout
273         settings = sc.clip.tracking.settings
274
275         col = layout.column(align=True)
276         col.operator("clip.set_floor")
277         col.operator("clip.set_origin")
278
279         row = col.row()
280         row.operator("clip.set_axis", text="Set X Axis").axis = 'X'
281         row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y'
282
283         layout.separator()
284
285         col = layout.column()
286         col.operator("clip.set_scale")
287         col.prop(settings, "distance")
288
289
290 class CLIP_PT_tools_grease_pencil(Panel):
291     bl_space_type = 'CLIP_EDITOR'
292     bl_region_type = 'TOOLS'
293     bl_label = "Grease Pencil"
294
295     @classmethod
296     def poll(cls, context):
297         sc = context.space_data
298         clip = sc.clip
299
300         return clip and sc.mode == 'DISTORTION'
301
302     def draw(self, context):
303         layout = self.layout
304
305         col = layout.column(align=True)
306
307         row = col.row(align=True)
308         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
309         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
310
311         row = col.row(align=True)
312         row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
313         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
314
315         row = col.row()
316         row.prop(context.tool_settings, "use_grease_pencil_sessions")
317
318
319 class CLIP_PT_track(Panel):
320     bl_space_type = 'CLIP_EDITOR'
321     bl_region_type = 'UI'
322     bl_label = "Track"
323
324     @classmethod
325     def poll(cls, context):
326         sc = context.space_data
327         clip = sc.clip
328
329         return sc.mode == 'TRACKING' and clip
330
331     def draw(self, context):
332         layout = self.layout
333         sc = context.space_data
334         clip = context.space_data.clip
335         act_track = clip.tracking.tracks.active
336
337         if not act_track:
338             layout.active = False
339             layout.label(text="No active track")
340             return
341
342         row = layout.row()
343         row.prop(act_track, "name", text="")
344
345         sub = row.row(align=True)
346
347         sub.template_marker(sc, "clip", sc.clip_user, act_track, True)
348
349         icon = 'LOCKED' if act_track.lock else 'UNLOCKED'
350         sub.prop(act_track, "lock", text="", icon=icon)
351
352         layout.template_track(sc, "scopes")
353
354         row = layout.row(align=True)
355         row.prop(act_track, "use_red_channel", text="R", toggle=True)
356         row.prop(act_track, "use_green_channel", text="G", toggle=True)
357         row.prop(act_track, "use_blue_channel", text="B", toggle=True)
358
359         layout.separator()
360
361         row = layout.row(align=True)
362         label = bpy.types.CLIP_MT_track_color_presets.bl_label
363         row.menu('CLIP_MT_track_color_presets', text=label)
364         row.menu('CLIP_MT_track_color_specials', text="", icon='DOWNARROW_HLT')
365         row.operator("clip.track_color_preset_add", text="", icon='ZOOMIN')
366         props = row.operator("clip.track_color_preset_add",
367                              text="", icon='ZOOMOUT')
368         props.remove_active = True
369
370         row = layout.row()
371         row.prop(act_track, "use_custom_color")
372         if act_track.use_custom_color:
373             row.prop(act_track, "color", text="")
374
375         if act_track.has_bundle:
376             label_text = "Average Error: %.4f" % (act_track.average_error)
377             layout.label(text=label_text)
378
379
380 class CLIP_PT_tracking_camera(Panel):
381     bl_space_type = 'CLIP_EDITOR'
382     bl_region_type = 'UI'
383     bl_label = "Camera Data"
384     bl_options = {'DEFAULT_CLOSED'}
385
386     @classmethod
387     def poll(cls, context):
388         sc = context.space_data
389
390         return sc.mode in ['TRACKING', 'DISTORTION'] and sc.clip
391
392     def draw(self, context):
393         layout = self.layout
394
395         sc = context.space_data
396         clip = sc.clip
397
398         row = layout.row(align=True)
399         label = bpy.types.CLIP_MT_camera_presets.bl_label
400         row.menu('CLIP_MT_camera_presets', text=label)
401         row.operator("clip.camera_preset_add", text="", icon='ZOOMIN')
402         props = row.operator("clip.camera_preset_add", text="", icon='ZOOMOUT')
403         props.remove_active = True
404
405         row = layout.row(align=True)
406         sub = row.split(percentage=0.65)
407         if clip.tracking.camera.units == 'MILLIMETERS':
408             sub.prop(clip.tracking.camera, "focal_length")
409         else:
410             sub.prop(clip.tracking.camera, "focal_length_pixels")
411         sub.prop(clip.tracking.camera, "units", text="")
412
413         col = layout.column(align=True)
414         col.label(text="Sensor:")
415         col.prop(clip.tracking.camera, "sensor_width", text="Width")
416         col.prop(clip.tracking.camera, "pixel_aspect")
417
418         col = layout.column()
419         col.label(text="Optical Center:")
420         row = col.row()
421         row.prop(clip.tracking.camera, "principal", text="")
422         col.operator("clip.set_center_principal", text="Center")
423
424         col = layout.column(align=True)
425         col.label(text="Undistortion:")
426         col.prop(clip.tracking.camera, "k1")
427         col.prop(clip.tracking.camera, "k2")
428         col.prop(clip.tracking.camera, "k3")
429
430
431 class CLIP_PT_display(Panel):
432     bl_space_type = 'CLIP_EDITOR'
433     bl_region_type = 'UI'
434     bl_label = "Display"
435
436     def draw(self, context):
437         layout = self.layout
438         sc = context.space_data
439
440         col = layout.column(align=True)
441
442         col.prop(sc, "show_marker_pattern", text="Pattern")
443         col.prop(sc, "show_marker_search", text="Search")
444         col.prop(sc, "show_pyramid_levels", text="Pyramid")
445
446         col.prop(sc, "show_track_path", text="Path")
447         row = col.row()
448         row.active = sc.show_track_path
449         row.prop(sc, "path_length", text="Length")
450
451         col.prop(sc, "show_disabled", "Disabled Tracks")
452         col.prop(sc, "show_bundles", text="3D Markers")
453
454         col.prop(sc, "show_names", text="Names and Status")
455         col.prop(sc, "show_tiny_markers", text="Compact Markers")
456
457         col.prop(sc, "show_grease_pencil", text="Grease Pencil")
458         col.prop(sc, "use_mute_footage", text="Mute")
459
460         if sc.mode == 'DISTORTION':
461             col.prop(sc, "show_grid", text="Grid")
462             col.prop(sc, "use_manual_calibration")
463         elif sc.mode == 'RECONSTRUCTION':
464             col.prop(sc, "show_stable", text="Stable")
465
466         col.prop(sc, "lock_selection")
467
468         clip = sc.clip
469         if clip:
470             col.label(text="Display Aspect Ratio:")
471             col.prop(clip, "display_aspect", text="")
472
473
474 class CLIP_PT_track_settings(Panel):
475     bl_space_type = 'CLIP_EDITOR'
476     bl_region_type = 'UI'
477     bl_label = "Tracking Settings"
478     bl_options = {'DEFAULT_CLOSED'}
479
480     @classmethod
481     def poll(cls, context):
482         sc = context.space_data
483
484         return sc.mode == 'TRACKING' and sc.clip
485
486     def draw(self, context):
487         layout = self.layout
488         clip = context.space_data.clip
489         settings = clip.tracking.settings
490
491         col = layout.column()
492
493         active = clip.tracking.tracks.active
494         if active:
495             col.prop(active, "tracker")
496
497             if active.tracker == 'KLT':
498                 col.prop(active, "pyramid_levels")
499             col.prop(active, "correlation_min")
500
501             col.separator()
502             col.prop(active, "frames_limit")
503             col.prop(active, "margin")
504             col.prop(active, "pattern_match", text="Match")
505
506         col.prop(settings, "speed")
507
508
509 class CLIP_PT_stabilization(Panel):
510     bl_space_type = 'CLIP_EDITOR'
511     bl_region_type = 'UI'
512     bl_label = "2D Stabilization"
513     bl_options = {'DEFAULT_CLOSED'}
514
515     @classmethod
516     def poll(cls, context):
517         sc = context.space_data
518
519         return sc.mode == 'RECONSTRUCTION' and sc.clip
520
521     def draw_header(self, context):
522         stab = context.space_data.clip.tracking.stabilization
523
524         self.layout.prop(stab, "use_2d_stabilization", text="")
525
526     def draw(self, context):
527         layout = self.layout
528
529         tracking = context.space_data.clip.tracking
530         stab = tracking.stabilization
531
532         layout.active = stab.use_2d_stabilization
533
534         row = layout.row()
535         row.template_list(stab, "tracks", stab, "active_track_index", rows=3)
536
537         sub = row.column(align=True)
538
539         sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="")
540         sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="")
541
542         sub.menu('CLIP_MT_stabilize_2d_specials', text="",
543                  icon='DOWNARROW_HLT')
544
545         layout.prop(stab, "influence_location")
546
547         layout.prop(stab, "use_autoscale")
548         col = layout.column()
549         col.active = stab.use_autoscale
550         col.prop(stab, "scale_max")
551         col.prop(stab, "influence_scale")
552
553         layout.prop(stab, "use_stabilize_rotation")
554         col = layout.column()
555         col.active = stab.use_stabilize_rotation
556
557         row = col.row(align=True)
558         row.prop_search(stab, "rotation_track", tracking, "tracks", text="")
559         row.operator("clip.stabilize_2d_set_rotation", text="", icon='ZOOMIN')
560
561         row = col.row()
562         row.active = stab.rotation_track is not None
563         row.prop(stab, "influence_rotation")
564
565
566 class CLIP_PT_marker(Panel):
567     bl_space_type = 'CLIP_EDITOR'
568     bl_region_type = 'UI'
569     bl_label = "Marker"
570     bl_options = {'DEFAULT_CLOSED'}
571
572     @classmethod
573     def poll(cls, context):
574         sc = context.space_data
575         clip = sc.clip
576
577         return sc.mode == 'TRACKING' and clip
578
579     def draw(self, context):
580         layout = self.layout
581         sc = context.space_data
582         clip = context.space_data.clip
583         act_track = clip.tracking.tracks.active
584
585         if act_track:
586             layout.template_marker(sc, "clip", sc.clip_user, act_track, False)
587         else:
588             layout.active = False
589             layout.label(text="No active track")
590
591
592 class CLIP_PT_proxy(Panel):
593     bl_space_type = 'CLIP_EDITOR'
594     bl_region_type = 'UI'
595     bl_label = "Proxy / Timecode"
596     bl_options = {'DEFAULT_CLOSED'}
597
598     @classmethod
599     def poll(cls, context):
600         sc = context.space_data
601
602         return sc.clip
603
604     def draw_header(self, context):
605         sc = context.space_data
606
607         self.layout.prop(sc.clip, "use_proxy", text="")
608
609     def draw(self, context):
610         layout = self.layout
611         sc = context.space_data
612         clip = sc.clip
613
614         layout.active = clip.use_proxy
615
616         layout.label(text="Build Sizes:")
617
618         row = layout.row()
619         row.prop(clip.proxy, "build_25")
620         row.prop(clip.proxy, "build_50")
621
622         row = layout.row()
623         row.prop(clip.proxy, "build_75")
624         row.prop(clip.proxy, "build_100")
625
626         layout.prop(clip.proxy, "build_undistorted")
627
628         layout.prop(clip.proxy, "quality")
629
630         layout.prop(clip, 'use_proxy_custom_directory')
631         if clip.use_proxy_custom_directory:
632             layout.prop(clip.proxy, "directory")
633
634         layout.operator("clip.rebuild_proxy", text="Rebuild Proxy")
635
636         if clip.source == 'MOVIE':
637             col = layout.column()
638
639             col.label(text="Use timecode index:")
640             col.prop(clip.proxy, "timecode", text="")
641
642         col = layout.column()
643         col.label(text="Proxy render size:")
644
645         col.prop(sc.clip_user, "proxy_render_size", text="")
646         col.prop(sc.clip_user, "use_render_undistorted")
647
648
649 class CLIP_PT_footage(Panel):
650     bl_space_type = 'CLIP_EDITOR'
651     bl_region_type = 'UI'
652     bl_label = "Footage Settings"
653     bl_options = {'DEFAULT_CLOSED'}
654
655     @classmethod
656     def poll(cls, context):
657         sc = context.space_data
658
659         return sc.clip
660
661     def draw(self, context):
662         layout = self.layout
663
664         sc = context.space_data
665         clip = sc.clip
666
667         if clip:
668             layout.template_movieclip(sc, "clip", compact=True)
669         else:
670             layout.operator("clip.open", icon='FILESEL')
671
672
673 class CLIP_PT_tools_clip(Panel):
674     bl_space_type = 'CLIP_EDITOR'
675     bl_region_type = 'TOOLS'
676     bl_label = "Clip"
677
678     @classmethod
679     def poll(cls, context):
680         sc = context.space_data
681
682         return sc.clip
683
684     def draw(self, context):
685         layout = self.layout
686
687         layout.operator("clip.set_viewport_background")
688         layout.operator("clip.setup_tracking_scene")
689
690
691 class CLIP_MT_view(Menu):
692     bl_label = "View"
693
694     def draw(self, context):
695         layout = self.layout
696
697         layout.operator("clip.properties", icon='MENU_PANEL')
698         layout.operator("clip.tools", icon='MENU_PANEL')
699         layout.separator()
700
701         layout.operator("clip.view_selected")
702         layout.operator("clip.view_all")
703
704         layout.separator()
705         layout.operator("clip.view_zoom_in")
706         layout.operator("clip.view_zoom_out")
707
708         layout.separator()
709
710         ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
711
712         for a, b in ratios:
713             text = "Zoom %d:%d" % (a, b)
714             layout.operator("clip.view_zoom_ratio", text=text).ratio = a / b
715
716         layout.separator()
717         layout.operator("screen.area_dupli")
718         layout.operator("screen.screen_full_area")
719
720
721 class CLIP_MT_clip(Menu):
722     bl_label = "Clip"
723
724     def draw(self, context):
725         layout = self.layout
726
727         sc = context.space_data
728         clip = sc.clip
729
730         layout.operator("clip.open")
731
732         if clip:
733             layout.operator("clip.reload")
734             layout.menu("CLIP_MT_proxy")
735
736
737 class CLIP_MT_proxy(Menu):
738     bl_label = "Proxy"
739
740     def draw(self, context):
741         layout = self.layout
742
743         layout.operator("clip.rebuild_proxy")
744         layout.operator("clip.delete_proxy")
745
746
747 class CLIP_MT_track(Menu):
748     bl_label = "Track"
749
750     def draw(self, context):
751         layout = self.layout
752
753         layout.operator("clip.clear_solution")
754         layout.operator("clip.solve_camera")
755
756         layout.separator()
757         props = layout.operator("clip.clear_track_path", text="Clear After")
758         props.action = 'REMAINED'
759
760         props = layout.operator("clip.clear_track_path", text="Clear Before")
761         props.action = 'UPTO'
762
763         props = layout.operator("clip.clear_track_path",
764             text="Clear Track Path")
765         props.action = 'ALL'
766
767         layout.separator()
768         layout.operator("clip.join_tracks")
769
770         layout.separator()
771         layout.operator("clip.clean_tracks")
772
773         layout.separator()
774         props = layout.operator("clip.track_markers",
775             text="Track Frame Backwards")
776         props.backwards = True
777
778         props = layout.operator("clip.track_markers", text="Track Backwards")
779         props.backwards = True
780         props.sequence = True
781
782         props = layout.operator("clip.track_markers", text="Track Forwards")
783         props.sequence = True
784         layout.operator("clip.track_markers", text="Track Frame Forwards")
785
786         layout.separator()
787         layout.operator("clip.delete_track")
788         layout.operator("clip.delete_marker")
789
790         layout.separator()
791         layout.operator("clip.add_marker_move")
792
793         layout.separator()
794         layout.menu("CLIP_MT_track_visibility")
795         layout.menu("CLIP_MT_track_transform")
796
797
798 class CLIP_MT_reconstruction(Menu):
799     bl_label = "Reconstruction"
800
801     def draw(self, context):
802         layout = self.layout
803
804         layout.operator("clip.set_origin")
805         layout.operator("clip.set_floor")
806
807         layout.operator("clip.set_axis", text="Set X Axis").axis = "X"
808         layout.operator("clip.set_axis", text="Set Y Axis").axis = "Y"
809
810         layout.operator("clip.set_scale")
811
812         layout.separator()
813
814         layout.operator("clip.track_to_empty")
815         layout.operator("clip.bundles_to_mesh")
816
817
818 class CLIP_MT_track_visibility(Menu):
819     bl_label = "Show/Hide"
820
821     def draw(self, context):
822         layout = self.layout
823
824         layout.operator("clip.hide_tracks_clear", text="Show Hidden")
825         layout.operator("clip.hide_tracks", text="Hide Selected")
826
827         props = layout.operator("clip.hide_tracks", text="Hide Unselected")
828         props.unselected = True
829
830
831 class CLIP_MT_track_transform(Menu):
832     bl_label = "Transform"
833
834     def draw(self, context):
835         layout = self.layout
836
837         layout.operator("transform.translate")
838         layout.operator("transform.resize")
839
840
841 class CLIP_MT_select(Menu):
842     bl_label = "Select"
843
844     def draw(self, context):
845         layout = self.layout
846
847         layout.operator("clip.select_border")
848         layout.operator("clip.select_circle")
849
850         layout.separator()
851
852         layout.operator("clip.select_all", text="Select/Deselect all")
853         layout.operator("clip.select_all", text="Inverse").action = 'INVERT'
854
855         layout.menu("CLIP_MT_select_grouped")
856
857
858 class CLIP_MT_select_grouped(Menu):
859     bl_label = "Select Grouped"
860
861     def draw(self, context):
862         layout = self.layout
863
864         layout.operator_enum("clip.select_grouped", "group")
865
866
867 class CLIP_MT_tracking_specials(Menu):
868     bl_label = "Specials"
869
870     @classmethod
871     def poll(cls, context):
872         return context.space_data.clip
873
874     def draw(self, context):
875         layout = self.layout
876
877         props = layout.operator("clip.disable_markers", text="Enable Markers")
878         props.action = 'ENABLE'
879
880         props = layout.operator("clip.disable_markers", text="Disable markers")
881         props.action = 'DISABLE'
882
883         layout.separator()
884         layout.operator("clip.set_origin")
885
886         layout.separator()
887         layout.operator("clip.hide_tracks")
888         layout.operator("clip.hide_tracks_clear", text="Show Tracks")
889
890         layout.separator()
891         props = layout.operator("clip.lock_tracks", text="Lock Tracks")
892         props.action = 'LOCK'
893
894         props = layout.operator("clip.lock_tracks", text="Unlock Tracks")
895         props.action = 'UNLOCK'
896
897
898 class CLIP_MT_camera_presets(Menu):
899     """Predefined tracking camera intrinsics"""
900     bl_label = "Camera Presets"
901     preset_subdir = "tracking_camera"
902     preset_operator = "script.execute_preset"
903     draw = bpy.types.Menu.draw_preset
904
905
906 class CLIP_MT_track_color_presets(Menu):
907     """Predefined track color"""
908     bl_label = "Color Presets"
909     preset_subdir = "tracking_track_color"
910     preset_operator = "script.execute_preset"
911     draw = bpy.types.Menu.draw_preset
912
913
914 class CLIP_MT_tracking_settings_presets(Menu):
915     """Predefined tracking settings"""
916     bl_label = "Tracking Presets"
917     preset_subdir = "tracking_settings"
918     preset_operator = "script.execute_preset"
919     draw = bpy.types.Menu.draw_preset
920
921
922 class CLIP_MT_track_color_specials(Menu):
923     bl_label = "Track Color Specials"
924
925     def draw(self, context):
926         layout = self.layout
927
928         layout.operator('clip.track_copy_color', icon='COPY_ID')
929
930
931 class CLIP_MT_stabilize_2d_specials(Menu):
932     bl_label = "Track Color Specials"
933
934     def draw(self, context):
935         layout = self.layout
936
937         layout.operator('clip.stabilize_2d_select')
938
939 if __name__ == "__main__":  # only for live edit.
940     bpy.utils.register_module(__name__)