1 # ##### BEGIN GPL LICENSE BLOCK #####
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.
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.
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.
17 # ##### END GPL LICENSE BLOCK #####
22 from bpy.types import Panel, Header, Menu
23 from bl_ui.properties_mask_common import (MASK_PT_mask,
30 class CLIP_HT_header(Header):
31 bl_space_type = 'CLIP_EDITOR'
33 def _draw_tracking(self, context):
36 sc = context.space_data
39 row = layout.row(align=True)
42 if context.area.show_menus:
43 sub = row.row(align=True)
44 sub.menu("CLIP_MT_view")
48 sub.menu("CLIP_MT_select")
49 sub.menu("CLIP_MT_clip")
50 sub.menu("CLIP_MT_track")
51 sub.menu("CLIP_MT_reconstruction")
53 sub.menu("CLIP_MT_clip")
56 row.template_ID(sc, "clip", open="clip.open")
59 tracking = clip.tracking
60 active_object = tracking.objects.active
63 layout.prop(sc, "mode", text="")
64 layout.prop(sc, "view", text="", expand=True)
65 layout.prop(sc, "pivot_point", text="", icon_only=True)
67 r = active_object.reconstruction
69 if r.is_valid and sc.view == 'CLIP':
70 layout.label(text="Solve error: %.4f" %
72 elif sc.view == 'GRAPH':
73 layout.prop(sc, "view", text="", expand=True)
75 row = layout.row(align=True)
76 row.prop(sc, "show_graph_only_selected", text="")
77 row.prop(sc, "show_graph_hidden", text="")
79 row = layout.row(align=True)
82 row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_DOWN',
86 sub.active = clip.tracking.reconstruction.is_valid
87 sub.prop(sc, "show_graph_frames", icon='SEQUENCE', text="")
89 row.prop(sc, "show_graph_tracks", icon='ANIM', text="")
91 row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_RIGHT',
93 elif sc.view == 'DOPESHEET':
94 dopesheet = tracking.dopesheet
95 layout.prop(sc, "view", text="", expand=True)
97 row = layout.row(align=True)
98 row.prop(dopesheet, "show_only_selected", text="")
99 row.prop(dopesheet, "show_hidden", text="")
101 row = layout.row(align=True)
102 row.prop(dopesheet, "sort_method", text="")
103 row.prop(dopesheet, "use_invert_sort",
104 text="Invert", toggle=True)
106 layout.prop(sc, "view", text="", expand=True)
108 def _draw_masking(self, context):
111 toolsettings = context.tool_settings
112 sc = context.space_data
115 row = layout.row(align=True)
116 row.template_header()
118 if context.area.show_menus:
119 sub = row.row(align=True)
120 sub.menu("CLIP_MT_view")
123 sub.menu("MASK_MT_select")
124 sub.menu("CLIP_MT_clip") # XXX - remove?
125 sub.menu("MASK_MT_mask")
127 sub.menu("CLIP_MT_clip") # XXX - remove?
130 row.template_ID(sc, "clip", open="clip.open")
132 layout.prop(sc, "mode", text="")
135 row.template_ID(sc, "mask", new="mask.new")
137 layout.prop(sc, "pivot_point", text="", icon_only=True)
139 row = layout.row(align=True)
140 row.prop(toolsettings, "use_proportional_edit_mask",
141 text="", icon_only=True)
142 if toolsettings.use_proportional_edit_mask:
143 row.prop(toolsettings, "proportional_edit_falloff",
144 text="", icon_only=True)
146 def draw(self, context):
149 sc = context.space_data
151 if sc.mode in {'TRACKING', 'RECONSTRUCTION', 'DISTORTION'}:
152 self._draw_tracking(context)
154 self._draw_masking(context)
156 layout.template_running_jobs()
159 class CLIP_PT_clip_view_panel:
162 def poll(cls, context):
163 sc = context.space_data
166 return clip and sc.view == 'CLIP'
169 class CLIP_PT_mask_view_panel:
172 def poll(cls, context):
173 sc = context.space_data
176 return clip and sc.view == 'CLIP' and sc.mode == 'MASKEDIT'
179 class CLIP_PT_tracking_panel:
182 def poll(cls, context):
183 sc = context.space_data
186 return clip and sc.mode == 'TRACKING' and sc.view == 'CLIP'
189 class CLIP_PT_reconstruction_panel:
192 def poll(cls, context):
193 sc = context.space_data
196 return clip and sc.mode == 'RECONSTRUCTION' and sc.view == 'CLIP'
199 class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
200 bl_space_type = 'CLIP_EDITOR'
201 bl_region_type = 'TOOLS'
204 def draw(self, context):
205 sc = context.space_data
207 settings = clip.tracking.settings
210 col = layout.column(align=True)
211 col.operator("clip.add_marker_move")
212 col.operator("clip.detect_features")
213 col.operator("clip.delete_track")
216 row = box.row(align=True)
217 row.prop(settings, "show_default_expanded", text="", emboss=False)
218 row.label(text="Tracking Settings")
220 if settings.show_default_expanded:
222 row = col.row(align=True)
223 label = CLIP_MT_tracking_settings_presets.bl_label
224 row.menu('CLIP_MT_tracking_settings_presets', text=label)
225 row.operator("clip.tracking_settings_preset_add",
226 text="", icon='ZOOMIN')
227 props = row.operator("clip.tracking_settings_preset_add",
228 text="", icon='ZOOMOUT')
229 props.remove_active = True
233 row = col.row(align=True)
234 row.prop(settings, "use_default_red_channel",
235 text="R", toggle=True)
236 row.prop(settings, "use_default_green_channel",
237 text="G", toggle=True)
238 row.prop(settings, "use_default_blue_channel",
239 text="B", toggle=True)
243 sub = col.column(align=True)
244 sub.prop(settings, "default_pattern_size")
245 sub.prop(settings, "default_search_size")
247 col.label(text="Tracker:")
248 col.prop(settings, "default_motion_model")
249 col.prop(settings, "default_use_brute")
250 col.prop(settings, "default_use_normalization")
251 col.prop(settings, "default_use_mask")
252 col.prop(settings, "default_correlation_min")
256 sub = col.column(align=True)
257 sub.prop(settings, "default_frames_limit")
258 sub.prop(settings, "default_margin")
260 col.label(text="Match:")
261 col.prop(settings, "default_pattern_match", text="")
264 col.operator("clip.track_settings_as_default",
265 text="Copy From Active Track")
268 class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel):
269 bl_space_type = 'CLIP_EDITOR'
270 bl_region_type = 'TOOLS'
273 def draw(self, context):
276 row = layout.row(align=True)
278 props = row.operator("clip.track_markers", text="", icon='FRAME_PREV')
279 props.backwards = True
280 props.sequence = False
281 props = row.operator("clip.track_markers", text="",
283 props.backwards = True
284 props.sequence = True
285 props = row.operator("clip.track_markers", text="", icon='PLAY')
286 props.backwards = False
287 props.sequence = True
288 props = row.operator("clip.track_markers", text="", icon='FRAME_NEXT')
289 props.backwards = False
290 props.sequence = False
292 col = layout.column(align=True)
293 props = col.operator("clip.clear_track_path", text="Clear After")
294 props.action = 'REMAINED'
296 props = col.operator("clip.clear_track_path", text="Clear Before")
297 props.action = 'UPTO'
298 col.operator("clip.clear_track_path", text="Clear").action = 'ALL'
300 layout.operator("clip.join_tracks", text="Join")
303 class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
304 bl_space_type = 'CLIP_EDITOR'
305 bl_region_type = 'TOOLS'
308 def draw(self, context):
310 clip = context.space_data.clip
311 tracking = clip.tracking
312 settings = tracking.settings
313 tracking_object = tracking.objects.active
315 col = layout.column(align=True)
317 col.operator("clip.solve_camera",
318 text="Camera Motion" if tracking_object.is_camera
319 else "Object Motion")
320 col.operator("clip.clear_solution")
322 col = layout.column()
323 col.prop(settings, "use_tripod_solver")
325 col = layout.column(align=True)
326 col.active = not settings.use_tripod_solver
327 col.prop(settings, "keyframe_a")
328 col.prop(settings, "keyframe_b")
330 col = layout.column(align=True)
331 col.active = (tracking_object.is_camera and
332 not settings.use_tripod_solver)
333 col.label(text="Refine:")
334 col.prop(settings, "refine_intrinsics", text="")
337 class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel):
338 bl_space_type = 'CLIP_EDITOR'
339 bl_region_type = 'TOOLS'
340 bl_label = "Clean up"
342 def draw(self, context):
344 clip = context.space_data.clip
345 settings = clip.tracking.settings
347 layout.operator("clip.clean_tracks")
349 layout.prop(settings, "clean_frames", text="Frames")
350 layout.prop(settings, "clean_error", text="Error")
351 layout.prop(settings, "clean_action", text="")
354 class CLIP_PT_tools_geometry(CLIP_PT_reconstruction_panel, Panel):
355 bl_space_type = 'CLIP_EDITOR'
356 bl_region_type = 'TOOLS'
357 bl_label = "Geometry"
359 def draw(self, context):
362 layout.operator("clip.bundles_to_mesh")
363 layout.operator("clip.track_to_empty")
366 class CLIP_PT_tools_orientation(CLIP_PT_reconstruction_panel, Panel):
367 bl_space_type = 'CLIP_EDITOR'
368 bl_region_type = 'TOOLS'
369 bl_label = "Orientation"
371 def draw(self, context):
372 sc = context.space_data
374 settings = sc.clip.tracking.settings
376 col = layout.column(align=True)
378 props = row.operator("clip.set_plane", text="Floor")
379 props.plane = 'FLOOR'
380 props = row.operator("clip.set_plane", text="Wall")
382 col.operator("clip.set_origin")
385 row.operator("clip.set_axis", text="Set X Axis").axis = 'X'
386 row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y'
390 col = layout.column()
391 col.operator("clip.set_scale")
392 col.prop(settings, "distance")
395 class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel):
396 bl_space_type = 'CLIP_EDITOR'
397 bl_region_type = 'TOOLS'
401 def poll(cls, context):
402 if CLIP_PT_reconstruction_panel.poll(context):
403 sc = context.space_data
406 tracking_object = clip.tracking.objects.active
408 return not tracking_object.is_camera
412 def draw(self, context):
415 sc = context.space_data
417 tracking_object = clip.tracking.objects.active
418 settings = sc.clip.tracking.settings
420 col = layout.column()
422 col.prop(tracking_object, "scale")
426 col.operator("clip.set_solution_scale", text="Set Scale")
427 col.prop(settings, "object_distance")
430 class CLIP_PT_tools_mask(MASK_PT_tools, CLIP_PT_mask_view_panel, Panel):
431 bl_space_type = 'CLIP_EDITOR'
432 bl_region_type = 'TOOLS'
435 class CLIP_PT_tools_grease_pencil(Panel):
436 bl_space_type = 'CLIP_EDITOR'
437 bl_region_type = 'TOOLS'
438 bl_label = "Grease Pencil"
441 def poll(cls, context):
442 sc = context.space_data
448 if sc.mode == 'DISTORTION':
449 return sc.view == 'CLIP'
450 elif sc.mode == 'MASKEDIT':
455 def draw(self, context):
458 col = layout.column(align=True)
460 row = col.row(align=True)
461 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
462 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
464 row = col.row(align=True)
465 row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
466 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
469 row.prop(context.tool_settings, "use_grease_pencil_sessions")
472 class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
473 bl_space_type = 'CLIP_EDITOR'
474 bl_region_type = 'UI'
476 bl_options = {'DEFAULT_CLOSED'}
478 def draw(self, context):
481 sc = context.space_data
482 tracking = sc.clip.tracking
485 row.template_list(tracking, "objects",
486 tracking, "active_object_index", rows=3)
488 sub = row.column(align=True)
490 sub.operator("clip.tracking_object_new", icon='ZOOMIN', text="")
491 sub.operator("clip.tracking_object_remove", icon='ZOOMOUT', text="")
493 active = tracking.objects.active
495 layout.prop(active, "name")
498 class CLIP_PT_track(CLIP_PT_tracking_panel, Panel):
499 bl_space_type = 'CLIP_EDITOR'
500 bl_region_type = 'UI'
503 def draw(self, context):
505 sc = context.space_data
506 clip = context.space_data.clip
507 act_track = clip.tracking.tracks.active
510 layout.active = False
511 layout.label(text="No active track")
515 row.prop(act_track, "name", text="")
517 sub = row.row(align=True)
519 sub.template_marker(sc, "clip", sc.clip_user, act_track, True)
521 icon = 'LOCKED' if act_track.lock else 'UNLOCKED'
522 sub.prop(act_track, "lock", text="", icon=icon)
524 layout.template_track(sc, "scopes")
526 row = layout.row(align=True)
528 sub.prop(act_track, "use_red_channel", text="R", toggle=True)
529 sub.prop(act_track, "use_green_channel", text="G", toggle=True)
530 sub.prop(act_track, "use_blue_channel", text="B", toggle=True)
535 sub.prop(act_track, "use_grayscale_preview", text="B/W", toggle=True)
539 sub.prop(act_track, "use_alpha_preview",
540 text="", toggle=True, icon='IMAGE_ALPHA')
544 row = layout.row(align=True)
545 label = bpy.types.CLIP_MT_track_color_presets.bl_label
546 row.menu('CLIP_MT_track_color_presets', text=label)
547 row.menu('CLIP_MT_track_color_specials', text="", icon='DOWNARROW_HLT')
548 row.operator("clip.track_color_preset_add", text="", icon='ZOOMIN')
549 props = row.operator("clip.track_color_preset_add",
550 text="", icon='ZOOMOUT')
551 props.remove_active = True
554 row.prop(act_track, "use_custom_color")
555 if act_track.use_custom_color:
556 row.prop(act_track, "color", text="")
558 if act_track.has_bundle:
559 label_text = "Average Error: %.4f" % (act_track.average_error)
560 layout.label(text=label_text)
563 class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel):
564 bl_space_type = 'CLIP_EDITOR'
565 bl_region_type = 'UI'
566 bl_label = "Tracking Settings"
567 bl_options = {'DEFAULT_CLOSED'}
569 def draw(self, context):
571 clip = context.space_data.clip
572 settings = clip.tracking.settings
574 col = layout.column()
576 active = clip.tracking.tracks.active
578 col.prop(active, "motion_model")
579 col.prop(active, "use_brute")
580 col.prop(active, "use_normalization")
581 col.prop(active, "use_mask")
582 col.prop(active, "correlation_min")
585 col.prop(active, "frames_limit")
586 col.prop(active, "margin")
587 col.prop(active, "pattern_match", text="Match")
589 col.prop(settings, "speed")
592 class CLIP_PT_tracking_camera(Panel):
593 bl_space_type = 'CLIP_EDITOR'
594 bl_region_type = 'UI'
595 bl_label = "Camera Data"
596 bl_options = {'DEFAULT_CLOSED'}
599 def poll(cls, context):
600 if CLIP_PT_clip_view_panel.poll(context):
601 sc = context.space_data
603 return sc.mode in {'TRACKING', 'DISTORTION'} and sc.clip
607 def draw(self, context):
610 sc = context.space_data
613 row = layout.row(align=True)
614 label = bpy.types.CLIP_MT_camera_presets.bl_label
615 row.menu('CLIP_MT_camera_presets', text=label)
616 row.operator("clip.camera_preset_add", text="", icon='ZOOMIN')
617 props = row.operator("clip.camera_preset_add", text="", icon='ZOOMOUT')
618 props.remove_active = True
620 row = layout.row(align=True)
621 sub = row.split(percentage=0.65)
622 if clip.tracking.camera.units == 'MILLIMETERS':
623 sub.prop(clip.tracking.camera, "focal_length")
625 sub.prop(clip.tracking.camera, "focal_length_pixels")
626 sub.prop(clip.tracking.camera, "units", text="")
628 col = layout.column(align=True)
629 col.label(text="Sensor:")
630 col.prop(clip.tracking.camera, "sensor_width", text="Width")
631 col.prop(clip.tracking.camera, "pixel_aspect")
633 col = layout.column()
634 col.label(text="Optical Center:")
636 row.prop(clip.tracking.camera, "principal", text="")
637 col.operator("clip.set_center_principal", text="Center")
639 col = layout.column(align=True)
640 col.label(text="Lens Distortion:")
641 col.prop(clip.tracking.camera, "k1")
642 col.prop(clip.tracking.camera, "k2")
643 col.prop(clip.tracking.camera, "k3")
646 class CLIP_PT_mask_layers(MASK_PT_layers, Panel):
647 bl_space_type = 'CLIP_EDITOR'
648 bl_region_type = 'UI'
651 class CLIP_PT_active_mask_spline(MASK_PT_spline, Panel):
652 bl_space_type = 'CLIP_EDITOR'
653 bl_region_type = 'UI'
656 class CLIP_PT_active_mask_point(MASK_PT_point, Panel):
657 bl_space_type = 'CLIP_EDITOR'
658 bl_region_type = 'UI'
661 class CLIP_PT_display(CLIP_PT_clip_view_panel, Panel):
662 bl_space_type = 'CLIP_EDITOR'
663 bl_region_type = 'UI'
666 def draw(self, context):
668 sc = context.space_data
670 row = layout.row(align=True)
672 sub.prop(sc, "show_red_channel", text="R", toggle=True)
673 sub.prop(sc, "show_green_channel", text="G", toggle=True)
674 sub.prop(sc, "show_blue_channel", text="B", toggle=True)
679 sub.prop(sc, "use_grayscale_preview", text="B/W", toggle=True)
681 col = layout.column(align=True)
683 col.prop(sc, "show_disabled", "Disabled Tracks")
684 col.prop(sc, "show_names", text="Names and Status")
685 col.prop(sc, "show_bundles", text="3D Markers")
687 col.prop(sc, "use_mute_footage", text="Mute Footage")
688 col.prop(sc, "lock_selection")
690 if sc.view == 'GRAPH':
691 col.prop(sc, "lock_time_cursor")
693 if sc.mode == 'DISTORTION':
694 col.prop(sc, "show_grid", text="Grid")
695 col.prop(sc, "use_manual_calibration")
696 elif sc.mode == 'RECONSTRUCTION':
697 col.prop(sc, "show_stable", text="Stable")
701 col.label(text="Display Aspect Ratio:")
703 row.prop(clip, "display_aspect", text="")
706 class CLIP_PT_mask(MASK_PT_mask, CLIP_PT_mask_view_panel, Panel):
707 bl_space_type = 'CLIP_EDITOR'
708 bl_region_type = 'UI'
711 class CLIP_PT_mask_display(MASK_PT_display, CLIP_PT_mask_view_panel, Panel):
712 bl_space_type = 'CLIP_EDITOR'
713 bl_region_type = 'UI'
716 class CLIP_PT_marker_display(CLIP_PT_clip_view_panel, Panel):
717 bl_space_type = 'CLIP_EDITOR'
718 bl_region_type = 'UI'
719 bl_label = "Marker Display"
722 def poll(cls, context):
723 sc = context.space_data
725 return sc.mode != 'MASKEDIT'
727 def draw(self, context):
729 sc = context.space_data
731 col = layout.column(align=True)
734 row.prop(sc, "show_marker_pattern", text="Pattern")
735 row.prop(sc, "show_marker_search", text="Search")
737 col.prop(sc, "show_tiny_markers", text="Thin Markers")
738 col.prop(sc, "show_track_path", text="Path")
741 row.active = sc.show_track_path
742 row.prop(sc, "path_length", text="Length")
745 class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
746 bl_space_type = 'CLIP_EDITOR'
747 bl_region_type = 'UI'
748 bl_label = "2D Stabilization"
749 bl_options = {'DEFAULT_CLOSED'}
751 def draw_header(self, context):
752 stab = context.space_data.clip.tracking.stabilization
754 self.layout.prop(stab, "use_2d_stabilization", text="")
756 def draw(self, context):
759 tracking = context.space_data.clip.tracking
760 stab = tracking.stabilization
762 layout.active = stab.use_2d_stabilization
765 row.template_list(stab, "tracks", stab, "active_track_index", rows=3)
767 sub = row.column(align=True)
769 sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="")
770 sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="")
772 sub.menu('CLIP_MT_stabilize_2d_specials', text="",
773 icon='DOWNARROW_HLT')
775 layout.prop(stab, "influence_location")
777 layout.prop(stab, "use_autoscale")
778 col = layout.column()
779 col.active = stab.use_autoscale
780 col.prop(stab, "scale_max")
781 col.prop(stab, "influence_scale")
783 layout.prop(stab, "use_stabilize_rotation")
784 col = layout.column()
785 col.active = stab.use_stabilize_rotation
787 row = col.row(align=True)
788 row.prop_search(stab, "rotation_track", tracking, "tracks", text="")
789 row.operator("clip.stabilize_2d_set_rotation", text="", icon='ZOOMIN')
792 row.active = stab.rotation_track is not None
793 row.prop(stab, "influence_rotation")
795 layout.prop(stab, "filter_type")
798 class CLIP_PT_marker(CLIP_PT_tracking_panel, Panel):
799 bl_space_type = 'CLIP_EDITOR'
800 bl_region_type = 'UI'
802 bl_options = {'DEFAULT_CLOSED'}
804 def draw(self, context):
806 sc = context.space_data
807 clip = context.space_data.clip
808 act_track = clip.tracking.tracks.active
811 layout.template_marker(sc, "clip", sc.clip_user, act_track, False)
813 layout.active = False
814 layout.label(text="No active track")
817 class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel):
818 bl_space_type = 'CLIP_EDITOR'
819 bl_region_type = 'UI'
820 bl_label = "Proxy / Timecode"
821 bl_options = {'DEFAULT_CLOSED'}
823 def draw_header(self, context):
824 sc = context.space_data
826 self.layout.prop(sc.clip, "use_proxy", text="")
828 def draw(self, context):
830 sc = context.space_data
833 layout.active = clip.use_proxy
835 layout.label(text="Build Original:")
837 row = layout.row(align=True)
838 row.prop(clip.proxy, "build_25", toggle=True)
839 row.prop(clip.proxy, "build_50", toggle=True)
840 row.prop(clip.proxy, "build_75", toggle=True)
841 row.prop(clip.proxy, "build_100", toggle=True)
843 layout.label(text="Build Undistorted:")
845 row = layout.row(align=True)
846 row.prop(clip.proxy, "build_undistorted_25", toggle=True)
847 row.prop(clip.proxy, "build_undistorted_50", toggle=True)
848 row.prop(clip.proxy, "build_undistorted_75", toggle=True)
849 row.prop(clip.proxy, "build_undistorted_100", toggle=True)
851 layout.prop(clip.proxy, "quality")
853 layout.prop(clip, "use_proxy_custom_directory")
854 if clip.use_proxy_custom_directory:
855 layout.prop(clip.proxy, "directory")
857 layout.operator("clip.rebuild_proxy", text="Build Proxy")
859 if clip.source == 'MOVIE':
860 col = layout.column()
862 col.label(text="Use timecode index:")
863 col.prop(clip.proxy, "timecode", text="")
865 col = layout.column()
866 col.label(text="Proxy render size:")
868 col.prop(sc.clip_user, "proxy_render_size", text="")
869 col.prop(sc.clip_user, "use_render_undistorted")
872 class CLIP_PT_footage(CLIP_PT_clip_view_panel, Panel):
873 bl_space_type = 'CLIP_EDITOR'
874 bl_region_type = 'UI'
875 bl_label = "Footage Settings"
876 bl_options = {'DEFAULT_CLOSED'}
878 def draw(self, context):
881 sc = context.space_data
884 col = layout.column()
885 col.template_movieclip(sc, "clip", compact=True)
886 col.prop(clip, "start_frame")
887 col.prop(clip, "frame_offset")
890 class CLIP_PT_tools_clip(CLIP_PT_clip_view_panel, Panel):
891 bl_space_type = 'CLIP_EDITOR'
892 bl_region_type = 'TOOLS'
895 def draw(self, context):
898 layout.operator("clip.set_viewport_background")
899 layout.operator("clip.setup_tracking_scene")
902 class CLIP_MT_view(Menu):
905 def draw(self, context):
907 sc = context.space_data
909 if sc.view == 'CLIP':
910 layout.operator("clip.properties", icon='MENU_PANEL')
911 layout.operator("clip.tools", icon='MENU_PANEL')
914 layout.operator("clip.view_selected")
915 layout.operator("clip.view_all")
918 layout.operator("clip.view_zoom_in")
919 layout.operator("clip.view_zoom_out")
923 ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
926 text = "Zoom %d:%d" % (a, b)
927 layout.operator("clip.view_zoom_ratio",
928 text=text).ratio = a / b
930 layout.prop(sc, "show_seconds")
934 layout.operator("screen.area_dupli")
935 layout.operator("screen.screen_full_area")
938 class CLIP_MT_clip(Menu):
941 def draw(self, context):
944 sc = context.space_data
947 layout.operator("clip.open")
950 layout.operator("clip.reload")
951 layout.menu("CLIP_MT_proxy")
954 class CLIP_MT_proxy(Menu):
957 def draw(self, context):
960 layout.operator("clip.rebuild_proxy")
961 layout.operator("clip.delete_proxy")
964 class CLIP_MT_track(Menu):
967 def draw(self, context):
970 layout.operator("clip.clear_solution")
971 layout.operator("clip.solve_camera")
974 props = layout.operator("clip.clear_track_path", text="Clear After")
975 props.action = 'REMAINED'
977 props = layout.operator("clip.clear_track_path", text="Clear Before")
978 props.action = 'UPTO'
980 props = layout.operator("clip.clear_track_path",
981 text="Clear Track Path")
985 layout.operator("clip.join_tracks")
988 layout.operator("clip.clean_tracks")
991 layout.operator("clip.copy_tracks")
992 layout.operator("clip.paste_tracks")
995 props = layout.operator("clip.track_markers",
996 text="Track Frame Backwards")
997 props.backwards = True
999 props = layout.operator("clip.track_markers", text="Track Backwards")
1000 props.backwards = True
1001 props.sequence = True
1003 props = layout.operator("clip.track_markers", text="Track Forwards")
1004 props.sequence = True
1005 layout.operator("clip.track_markers", text="Track Frame Forwards")
1008 layout.operator("clip.delete_track")
1009 layout.operator("clip.delete_marker")
1012 layout.operator("clip.add_marker_move")
1015 layout.menu("CLIP_MT_track_visibility")
1016 layout.menu("CLIP_MT_track_transform")
1019 class CLIP_MT_reconstruction(Menu):
1020 bl_label = "Reconstruction"
1022 def draw(self, context):
1023 layout = self.layout
1025 layout.operator("clip.set_origin")
1026 props = layout.operator("clip.set_plane", text="Set Floor")
1027 props.plane = 'FLOOR'
1028 props = layout.operator("clip.set_plane", text="Set Wall")
1029 props.plane = 'WALL'
1031 layout.operator("clip.set_axis", text="Set X Axis").axis = "X"
1032 layout.operator("clip.set_axis", text="Set Y Axis").axis = "Y"
1034 layout.operator("clip.set_scale")
1038 layout.operator("clip.track_to_empty")
1039 layout.operator("clip.bundles_to_mesh")
1042 class CLIP_MT_track_visibility(Menu):
1043 bl_label = "Show/Hide"
1045 def draw(self, context):
1046 layout = self.layout
1048 layout.operator("clip.hide_tracks_clear", text="Show Hidden")
1049 layout.operator("clip.hide_tracks", text="Hide Selected")
1051 props = layout.operator("clip.hide_tracks", text="Hide Unselected")
1052 props.unselected = True
1055 class CLIP_MT_track_transform(Menu):
1056 bl_label = "Transform"
1058 def draw(self, context):
1059 layout = self.layout
1061 layout.operator("transform.translate")
1062 layout.operator("transform.resize")
1065 class CLIP_MT_select(Menu):
1068 def draw(self, context):
1069 layout = self.layout
1070 sc = context.space_data
1072 if sc.mode == 'MASKEDIT':
1073 layout.operator("mask.select_border")
1074 layout.operator("mask.select_circle")
1078 layout.operator("mask.select_all"
1080 layout.operator("mask.select_all",
1081 text="Inverse").action = 'INVERT'
1083 layout.operator("clip.select_border")
1084 layout.operator("clip.select_circle")
1088 layout.operator("clip.select_all"
1090 layout.operator("clip.select_all",
1091 text="Inverse").action = 'INVERT'
1093 layout.menu("CLIP_MT_select_grouped")
1096 class CLIP_MT_select_grouped(Menu):
1097 bl_label = "Select Grouped"
1099 def draw(self, context):
1100 layout = self.layout
1102 layout.operator_enum("clip.select_grouped", "group")
1105 class CLIP_MT_tracking_specials(Menu):
1106 bl_label = "Specials"
1109 def poll(cls, context):
1110 return context.space_data.clip
1112 def draw(self, context):
1113 layout = self.layout
1115 props = layout.operator("clip.disable_markers",
1116 text="Enable Markers")
1117 props.action = 'ENABLE'
1119 props = layout.operator("clip.disable_markers", text="Disable markers")
1120 props.action = 'DISABLE'
1123 layout.operator("clip.set_origin")
1126 layout.operator("clip.hide_tracks")
1127 layout.operator("clip.hide_tracks_clear", text="Show Tracks")
1130 props = layout.operator("clip.lock_tracks", text="Lock Tracks")
1131 props.action = 'LOCK'
1133 props = layout.operator("clip.lock_tracks", text="Unlock Tracks")
1134 props.action = 'UNLOCK'
1137 class CLIP_MT_select_mode(Menu):
1138 bl_label = "Select Mode"
1140 def draw(self, context):
1141 layout = self.layout
1143 layout.operator_context = 'INVOKE_REGION_WIN'
1145 layout.operator_enum("clip.mode_set", "mode")
1148 class CLIP_MT_camera_presets(Menu):
1149 """Predefined tracking camera intrinsics"""
1150 bl_label = "Camera Presets"
1151 preset_subdir = "tracking_camera"
1152 preset_operator = "script.execute_preset"
1153 draw = Menu.draw_preset
1156 class CLIP_MT_track_color_presets(Menu):
1157 """Predefined track color"""
1158 bl_label = "Color Presets"
1159 preset_subdir = "tracking_track_color"
1160 preset_operator = "script.execute_preset"
1161 draw = Menu.draw_preset
1164 class CLIP_MT_tracking_settings_presets(Menu):
1165 """Predefined tracking settings"""
1166 bl_label = "Tracking Presets"
1167 preset_subdir = "tracking_settings"
1168 preset_operator = "script.execute_preset"
1169 draw = Menu.draw_preset
1172 class CLIP_MT_track_color_specials(Menu):
1173 bl_label = "Track Color Specials"
1175 def draw(self, context):
1176 layout = self.layout
1178 layout.operator("clip.track_copy_color", icon='COPY_ID')
1181 class CLIP_MT_stabilize_2d_specials(Menu):
1182 bl_label = "Track Color Specials"
1184 def draw(self, context):
1185 layout = self.layout
1187 layout.operator("clip.stabilize_2d_select")
1189 if __name__ == "__main__": # only for live edit.
1190 bpy.utils.register_module(__name__)