Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # ##### BEGIN GPL LICENSE BLOCK ##### | 1 # ##### BEGIN GPL LICENSE BLOCK ##### |
2 # | 2 # |
3 # This program is free software; you can redistribute it and/or | 3 # This program is free software; you can redistribute it and/or |
4 # modify it under the terms of the GNU General Public License | 4 # modify it under the terms of the GNU General Public License |
5 # as published by the Free Software Foundation; either version 2 | 5 # as published by the Free Software Foundation; either version 2 |
6 # of the License, or (at your option) any later version. | 6 # of the License, or (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 sc = context.space_data | 30 sc = context.space_data |
31 clip = sc.clip | 31 clip = sc.clip |
32 | 32 |
33 row = layout.row(align=True) | 33 row = layout.row(align=True) |
34 row.template_header() | 34 row.template_header() |
35 | 35 |
36 if context.area.show_menus: | 36 if context.area.show_menus: |
37 sub = row.row(align=True) | 37 sub = row.row(align=True) |
38 sub.menu("CLIP_MT_view") | 38 sub.menu("CLIP_MT_view") |
39 sub.menu("CLIP_MT_clip") | |
40 | 39 |
41 if clip: | 40 if clip: |
42 sub.menu("CLIP_MT_select") | 41 sub.menu("CLIP_MT_select") |
42 | |
43 sub.menu("CLIP_MT_clip") | |
44 | |
45 if clip: | |
43 sub.menu("CLIP_MT_track") | 46 sub.menu("CLIP_MT_track") |
44 sub.menu("CLIP_MT_reconstruction") | 47 sub.menu("CLIP_MT_reconstruction") |
45 | 48 |
46 if clip: | 49 if clip: |
47 layout.prop(sc, "mode", text="") | 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', tex t="Filters") | |
58 row.prop(sc, "show_graph_frames", icon='SEQUENCE', text="") | |
59 row.prop(sc, "show_graph_tracks", icon='ANIM', text="") | |
60 else: | |
61 row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_RIGHT', te xt="Filters") | |
48 | 62 |
49 row = layout.row() | 63 row = layout.row() |
50 row.template_ID(sc, "clip", open='clip.open') | 64 row.template_ID(sc, "clip", open='clip.open') |
51 | 65 |
52 if clip: | 66 if clip: |
53 r = clip.tracking.reconstruction | 67 r = clip.tracking.reconstruction |
54 | 68 |
55 if r.is_reconstructed: | 69 if r.is_valid: |
56 layout.label(text="Average solve error: %.4f" % \ | 70 layout.label(text="Average solve error: %.4f" % |
57 (r.average_error)) | 71 (r.average_error)) |
58 | 72 |
59 layout.template_running_jobs() | 73 layout.template_running_jobs() |
60 | |
61 | |
62 class CLIP_PT_tools(Panel): | |
63 bl_space_type = 'CLIP_EDITOR' | |
64 bl_region_type = 'TOOLS' | |
65 bl_label = "Tools" | |
66 | |
67 @classmethod | |
68 def poll(cls, context): | |
69 sc = context.space_data | |
70 clip = sc.clip | |
71 | |
72 return not clip and sc.mode == 'TRACKING' | |
73 | |
74 def draw(self, context): | |
75 layout = self.layout | |
76 layout.operator('clip.open') | |
77 | 74 |
78 | 75 |
79 class CLIP_PT_tools_marker(Panel): | 76 class CLIP_PT_tools_marker(Panel): |
80 bl_space_type = 'CLIP_EDITOR' | 77 bl_space_type = 'CLIP_EDITOR' |
81 bl_region_type = 'TOOLS' | 78 bl_region_type = 'TOOLS' |
82 bl_label = "Marker" | 79 bl_label = "Marker" |
83 | 80 |
84 @classmethod | 81 @classmethod |
85 def poll(cls, context): | 82 def poll(cls, context): |
86 sc = context.space_data | 83 sc = context.space_data |
(...skipping 22 matching lines...) Expand all Loading... | |
109 | 106 |
110 return clip and sc.mode == 'TRACKING' | 107 return clip and sc.mode == 'TRACKING' |
111 | 108 |
112 def draw(self, context): | 109 def draw(self, context): |
113 layout = self.layout | 110 layout = self.layout |
114 clip = context.space_data.clip | 111 clip = context.space_data.clip |
115 settings = clip.tracking.settings | 112 settings = clip.tracking.settings |
116 | 113 |
117 row = layout.row(align=True) | 114 row = layout.row(align=True) |
118 | 115 |
119 op = row.operator("clip.track_markers", text="", icon='FRAME_PREV') | 116 props = row.operator("clip.track_markers", text="", icon='FRAME_PREV') |
120 op.backwards = True | 117 props.backwards = True |
121 op = row.operator("clip.track_markers", text="", \ | 118 props = row.operator("clip.track_markers", text="", |
122 icon='PLAY_REVERSE') | 119 icon='PLAY_REVERSE') |
123 op.backwards = True | 120 props.backwards = True |
124 op.sequence = True | 121 props.sequence = True |
125 op = row.operator("clip.track_markers", text="", icon='PLAY') | 122 props = row.operator("clip.track_markers", text="", icon='PLAY') |
126 op.sequence = True | 123 props.sequence = True |
127 row.operator("clip.track_markers", text="", icon='FRAME_NEXT') | 124 row.operator("clip.track_markers", text="", icon='FRAME_NEXT') |
128 | 125 |
129 col = layout.column(align=True) | 126 col = layout.column(align=True) |
130 op = col.operator("clip.clear_track_path", text="Clear After") | 127 props = col.operator("clip.clear_track_path", text="Clear After") |
131 op.action = 'REMAINED' | 128 props.action = 'REMAINED' |
132 | 129 |
133 op = col.operator("clip.clear_track_path", text="Clear Before") | 130 props = col.operator("clip.clear_track_path", text="Clear Before") |
134 op.action = 'UPTO' | 131 props.action = 'UPTO' |
135 | 132 |
136 op = col.operator("clip.clear_track_path", text="Clear Track Path") | 133 props = col.operator("clip.clear_track_path", text="Clear Track Path") |
137 op.action = 'ALL' | 134 props.action = 'ALL' |
138 | 135 |
139 layout.operator("clip.join_tracks") | 136 layout.operator("clip.join_tracks") |
140 | 137 |
141 | 138 |
142 class CLIP_PT_tools_solving(Panel): | 139 class CLIP_PT_tools_solving(Panel): |
143 bl_space_type = 'CLIP_EDITOR' | 140 bl_space_type = 'CLIP_EDITOR' |
144 bl_region_type = 'TOOLS' | 141 bl_region_type = 'TOOLS' |
145 bl_label = "Solving" | 142 bl_label = "Solving" |
146 | 143 |
147 @classmethod | 144 @classmethod |
148 def poll(cls, context): | 145 def poll(cls, context): |
149 sc = context.space_data | 146 sc = context.space_data |
150 clip = sc.clip | 147 clip = sc.clip |
151 | 148 |
152 return clip and sc.mode == 'TRACKING' | 149 return clip and sc.mode == 'TRACKING' |
153 | 150 |
154 def draw(self, context): | 151 def draw(self, context): |
155 layout = self.layout | 152 layout = self.layout |
156 clip = context.space_data.clip | 153 clip = context.space_data.clip |
157 settings = clip.tracking.settings | 154 settings = clip.tracking.settings |
158 | 155 |
159 col = layout.column(align=True) | 156 col = layout.column(align=True) |
160 col.prop(settings, "keyframe_a") | 157 col.prop(settings, "keyframe_a") |
161 col.prop(settings, "keyframe_b") | 158 col.prop(settings, "keyframe_b") |
162 | 159 |
163 col = layout.column(align=True) | 160 col = layout.column(align=True) |
164 col.operator("clip.solve_camera") | 161 col.operator("clip.solve_camera") |
165 col.operator("clip.clear_solution") | 162 col.operator("clip.clear_solution") |
brechtvl
2011/10/25 20:03:01
For consistency, put the operator buttons at the t
nazgul
2011/10/26 07:47:48
I'm not sure about this. That two keyframes are pr
| |
166 | 163 |
167 | 164 |
168 class CLIP_PT_tools_cleanup(Panel): | 165 class CLIP_PT_tools_cleanup(Panel): |
169 bl_space_type = 'CLIP_EDITOR' | 166 bl_space_type = 'CLIP_EDITOR' |
170 bl_region_type = 'TOOLS' | 167 bl_region_type = 'TOOLS' |
171 bl_label = "Clean up" | 168 bl_label = "Clean up" |
172 | 169 |
173 @classmethod | 170 @classmethod |
174 def poll(cls, context): | 171 def poll(cls, context): |
175 sc = context.space_data | 172 sc = context.space_data |
176 clip = sc.clip | 173 clip = sc.clip |
177 | 174 |
178 return clip and sc.mode == 'TRACKING' | 175 return clip and sc.mode == 'TRACKING' |
179 | 176 |
180 def draw(self, context): | 177 def draw(self, context): |
181 layout = self.layout | 178 layout = self.layout |
182 clip = context.space_data.clip | 179 clip = context.space_data.clip |
183 settings = clip.tracking.settings | 180 settings = clip.tracking.settings |
184 | 181 |
185 layout.prop(settings, 'clean_frames', text="Frames") | 182 layout.prop(settings, 'clean_frames', text="Frames") |
186 layout.prop(settings, 'clean_error', text="Error") | 183 layout.prop(settings, 'clean_error', text="Error") |
187 layout.prop(settings, 'clean_action', text="") | 184 layout.prop(settings, 'clean_action', text="") |
188 | 185 |
189 layout.operator("clip.clean_tracks") | 186 layout.operator("clip.clean_tracks") |
brechtvl
2011/10/25 20:03:01
For consistency, put the operator button at the to
nazgul
2011/10/26 07:47:48
The same thing as above.
| |
190 | 187 |
191 | 188 |
192 class CLIP_PT_tools_geometry(Panel): | 189 class CLIP_PT_tools_geometry(Panel): |
193 bl_space_type = 'CLIP_EDITOR' | 190 bl_space_type = 'CLIP_EDITOR' |
194 bl_region_type = 'TOOLS' | 191 bl_region_type = 'TOOLS' |
195 bl_label = "Geometry" | 192 bl_label = "Geometry" |
196 | 193 |
197 @classmethod | 194 @classmethod |
198 def poll(cls, context): | 195 def poll(cls, context): |
199 sc = context.space_data | 196 sc = context.space_data |
(...skipping 28 matching lines...) Expand all Loading... | |
228 col = layout.column(align=True) | 225 col = layout.column(align=True) |
229 col.label(text="Scene Orientation:") | 226 col.label(text="Scene Orientation:") |
230 col.operator("clip.set_floor") | 227 col.operator("clip.set_floor") |
231 col.operator("clip.set_origin") | 228 col.operator("clip.set_origin") |
232 | 229 |
233 row = col.row() | 230 row = col.row() |
234 row.operator("clip.set_axis", text="Set X Axis").axis = 'X' | 231 row.operator("clip.set_axis", text="Set X Axis").axis = 'X' |
235 row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y' | 232 row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y' |
236 | 233 |
237 col = layout.column() | 234 col = layout.column() |
238 col.prop(settings, "distance") | 235 col.prop(settings, "distance") |
brechtvl
2011/10/25 20:03:01
I'd move this property below the operator and use
nazgul
2011/10/26 07:47:48
Personally, i dislike way in which slider is getti
| |
239 col.operator("clip.set_scale") | 236 col.operator("clip.set_scale") |
240 | 237 |
241 | 238 |
242 class CLIP_PT_tools_grease_pencil(Panel): | 239 class CLIP_PT_tools_grease_pencil(Panel): |
243 bl_space_type = 'CLIP_EDITOR' | 240 bl_space_type = 'CLIP_EDITOR' |
244 bl_region_type = 'TOOLS' | 241 bl_region_type = 'TOOLS' |
245 bl_label = "Grease Pencil" | 242 bl_label = "Grease Pencil" |
246 | 243 |
247 @classmethod | 244 @classmethod |
248 def poll(cls, context): | 245 def poll(cls, context): |
(...skipping 28 matching lines...) Expand all Loading... | |
277 def poll(cls, context): | 274 def poll(cls, context): |
278 sc = context.space_data | 275 sc = context.space_data |
279 clip = sc.clip | 276 clip = sc.clip |
280 | 277 |
281 return sc.mode == 'TRACKING' and clip | 278 return sc.mode == 'TRACKING' and clip |
282 | 279 |
283 def draw(self, context): | 280 def draw(self, context): |
284 layout = self.layout | 281 layout = self.layout |
285 sc = context.space_data | 282 sc = context.space_data |
286 clip = context.space_data.clip | 283 clip = context.space_data.clip |
287 act_track = clip.tracking.active_track | 284 act_track = clip.tracking.tracks.active |
288 | 285 |
289 if not act_track: | 286 if not act_track: |
290 layout.active = False | 287 layout.active = False |
291 layout.label(text="No active track") | 288 layout.label(text="No active track") |
292 return | 289 return |
293 | 290 |
294 row = layout.row() | 291 row = layout.row() |
295 row.prop(act_track, "name", text="") | 292 row.prop(act_track, "name", text="") |
296 | 293 |
297 sub = row.row(align=True) | 294 sub = row.row(align=True) |
298 | 295 |
299 sub.template_marker(sc, "clip", sc.clip_user, act_track, True) | 296 sub.template_marker(sc, "clip", sc.clip_user, act_track, True) |
300 | 297 |
301 icon = 'LOCKED' if act_track.locked else 'UNLOCKED' | 298 icon = 'LOCKED' if act_track.lock else 'UNLOCKED' |
302 sub.prop(act_track, "locked", text="", icon=icon) | 299 sub.prop(act_track, "lock", text="", icon=icon) |
303 | 300 |
304 layout.template_track(sc, "scopes") | 301 layout.template_track(sc, "scopes") |
305 | 302 |
306 row = layout.row() | 303 row = layout.row() |
307 row.prop(act_track, "use_red_channel", text="Red") | 304 row.prop(act_track, "use_red_channel", text="Red") |
308 row.prop(act_track, "use_green_channel", text="Green") | 305 row.prop(act_track, "use_green_channel", text="Green") |
309 row.prop(act_track, "use_blue_channel", text="Blue") | 306 row.prop(act_track, "use_blue_channel", text="Blue") |
brechtvl
2011/10/25 20:03:01
These buttons don't fit well in the default region
nazgul
2011/10/26 07:47:48
It's really nice. Didn't know about toggle=True, t
| |
310 | 307 |
311 layout.separator() | 308 layout.separator() |
312 | 309 |
313 row = layout.row(align=True) | 310 row = layout.row(align=True) |
314 label = bpy.types.CLIP_MT_track_color_presets.bl_label | 311 label = bpy.types.CLIP_MT_track_color_presets.bl_label |
315 row.menu('CLIP_MT_track_color_presets', text=label) | 312 row.menu('CLIP_MT_track_color_presets', text=label) |
316 row.menu('CLIP_MT_track_color_specials', text="", icon="DOWNARROW_HLT") | 313 row.menu('CLIP_MT_track_color_specials', text="", icon="DOWNARROW_HLT") |
317 row.operator("clip.track_color_preset_add", text="", icon="ZOOMIN") | 314 row.operator("clip.track_color_preset_add", text="", icon="ZOOMIN") |
318 op = row.operator("clip.track_color_preset_add", \ | 315 props = row.operator("clip.track_color_preset_add", |
319 text="", icon="ZOOMOUT") | 316 text="", icon="ZOOMOUT") |
320 op.remove_active = True | 317 props.remove_active = True |
321 | 318 |
322 row = layout.row() | 319 row = layout.row() |
323 row.prop(act_track, "use_custom_color") | 320 row.prop(act_track, "use_custom_color") |
324 if act_track.use_custom_color: | 321 if act_track.use_custom_color: |
325 row.prop(act_track, "color", text="") | 322 row.prop(act_track, "color", text="") |
326 | 323 |
327 if act_track.has_bundle: | 324 if act_track.has_bundle: |
328 label_text = "Average Error: %.4f" % (act_track.average_error) | 325 label_text = "Average Error: %.4f" % (act_track.average_error) |
329 layout.label(text=label_text) | 326 layout.label(text=label_text) |
330 | 327 |
(...skipping 13 matching lines...) Expand all Loading... | |
344 def draw(self, context): | 341 def draw(self, context): |
345 layout = self.layout | 342 layout = self.layout |
346 | 343 |
347 sc = context.space_data | 344 sc = context.space_data |
348 clip = sc.clip | 345 clip = sc.clip |
349 | 346 |
350 row = layout.row(align=True) | 347 row = layout.row(align=True) |
351 label = bpy.types.CLIP_MT_camera_presets.bl_label | 348 label = bpy.types.CLIP_MT_camera_presets.bl_label |
352 row.menu('CLIP_MT_camera_presets', text=label) | 349 row.menu('CLIP_MT_camera_presets', text=label) |
353 row.operator("clip.camera_preset_add", text="", icon="ZOOMIN") | 350 row.operator("clip.camera_preset_add", text="", icon="ZOOMIN") |
354 op = row.operator("clip.camera_preset_add", text="", icon="ZOOMOUT") | 351 props = row.operator("clip.camera_preset_add", text="", icon="ZOOMOUT") |
355 op.remove_active = True | 352 props.remove_active = True |
356 | 353 |
357 row = layout.row(align=True) | 354 row = layout.row(align=True) |
358 sub = row.split(percentage=0.65) | 355 sub = row.split(percentage=0.65) |
359 sub.prop(clip.tracking.camera, "focal_length") | 356 sub.prop(clip.tracking.camera, "focal_length") |
360 sub.prop(clip.tracking.camera, "units", text="") | 357 sub.prop(clip.tracking.camera, "units", text="") |
361 | 358 |
362 col = layout.column(align=True) | 359 col = layout.column(align=True) |
363 col.label(text="Sensor:") | 360 col.label(text="Sensor:") |
364 col.prop(clip.tracking.camera, "sensor_width", text="Size") | 361 col.prop(clip.tracking.camera, "sensor_width", text="Size") |
365 col.prop(clip.tracking.camera, "pixel_aspect") | 362 col.prop(clip.tracking.camera, "pixel_aspect") |
(...skipping 13 matching lines...) Expand all Loading... | |
379 | 376 |
380 class CLIP_PT_display(Panel): | 377 class CLIP_PT_display(Panel): |
381 bl_space_type = 'CLIP_EDITOR' | 378 bl_space_type = 'CLIP_EDITOR' |
382 bl_region_type = 'UI' | 379 bl_region_type = 'UI' |
383 bl_label = "Display" | 380 bl_label = "Display" |
384 | 381 |
385 def draw(self, context): | 382 def draw(self, context): |
386 layout = self.layout | 383 layout = self.layout |
387 sc = context.space_data | 384 sc = context.space_data |
388 | 385 |
389 row = layout.row() | 386 layout.prop(sc, "show_marker_pattern", text="Pattern") |
390 row.prop(sc, "show_marker_pattern", text="Pattern") | 387 layout.prop(sc, "show_marker_search", text="Search") |
391 row.prop(sc, "show_marker_search", text="Search") | 388 |
392 | 389 layout.prop(sc, "show_track_path", text="Path") |
393 row = layout.row() | 390 row = layout.column() |
394 row.prop(sc, "show_track_path", text="Path") | 391 row.active = sc.show_track_path |
395 sub = row.column() | 392 row.prop(sc, "path_length", text="Length") |
396 sub.active = sc.show_track_path | 393 |
397 sub.prop(sc, "path_length", text="Length") | 394 layout.prop(sc, "show_disabled", text="Disabled") |
398 | 395 layout.prop(sc, "show_bundles", text="Bundles") |
399 row = layout.row() | 396 |
400 row.prop(sc, "show_disabled", text="Disabled") | 397 layout.prop(sc, "show_names", text="Names") |
401 row.prop(sc, "show_bundles", text="Bundles") | 398 layout.prop(sc, "show_tiny_markers", text="Tiny Markers") |
402 | 399 |
403 row = layout.row() | 400 layout.prop(sc, "show_grease_pencil", text="Grease Pencil") |
404 row.prop(sc, "show_names", text="Names") | 401 layout.prop(sc, "use_mute_footage", text="Mute") |
405 row.prop(sc, "show_tiny_markers", text="Tiny Markers") | |
406 | |
407 row = layout.row() | |
408 row.prop(sc, "show_grease_pencil", text="Grease Pencil") | |
409 row.prop(sc, "use_mute_footage", text="Mute") | |
410 | 402 |
411 if sc.mode == 'DISTORTION': | 403 if sc.mode == 'DISTORTION': |
412 layout.prop(sc, "show_grid", text="Grid") | 404 layout.prop(sc, "show_grid", text="Grid") |
413 layout.prop(sc, "use_manual_calibration") | 405 layout.prop(sc, "use_manual_calibration") |
414 elif sc.mode == 'RECONSTRUCTION': | 406 elif sc.mode == 'RECONSTRUCTION': |
415 layout.prop(sc, "show_stable", text="Stable") | 407 layout.prop(sc, "show_stable", text="Stable") |
416 | 408 |
417 layout.prop(sc, "lock_selection") | 409 layout.prop(sc, "lock_selection") |
418 | 410 |
419 clip = sc.clip | 411 clip = sc.clip |
(...skipping 14 matching lines...) Expand all Loading... | |
434 | 426 |
435 return sc.mode == 'TRACKING' and sc.clip | 427 return sc.mode == 'TRACKING' and sc.clip |
436 | 428 |
437 def draw(self, context): | 429 def draw(self, context): |
438 layout = self.layout | 430 layout = self.layout |
439 clip = context.space_data.clip | 431 clip = context.space_data.clip |
440 settings = clip.tracking.settings | 432 settings = clip.tracking.settings |
441 | 433 |
442 layout.prop(settings, "tracker") | 434 layout.prop(settings, "tracker") |
443 | 435 |
444 layout.prop(settings, "adjust_frames") | 436 layout.prop(settings, "frames_adjust") |
445 | 437 |
446 if settings.tracker == "SAD": | 438 if settings.tracker == "SAD": |
447 layout.prop(settings, "min_correlation") | 439 layout.prop(settings, "correlation_min") |
448 | 440 |
449 layout.prop(settings, "speed") | 441 layout.prop(settings, "speed") |
450 layout.prop(settings, "frames_limit") | 442 layout.prop(settings, "frames_limit") |
451 layout.prop(settings, "margin") | 443 layout.prop(settings, "margin") |
452 | 444 |
453 | 445 |
454 class CLIP_PT_stabilization(Panel): | 446 class CLIP_PT_stabilization(Panel): |
455 bl_space_type = 'CLIP_EDITOR' | 447 bl_space_type = 'CLIP_EDITOR' |
456 bl_region_type = 'UI' | 448 bl_region_type = 'UI' |
457 bl_label = "2D Stabilization" | 449 bl_label = "2D Stabilization" |
(...skipping 21 matching lines...) Expand all Loading... | |
479 layout.active = stab.use_2d_stabilization | 471 layout.active = stab.use_2d_stabilization |
480 | 472 |
481 row = layout.row() | 473 row = layout.row() |
482 row.template_list(stab, "tracks", stab, "active_track_index", rows=3) | 474 row.template_list(stab, "tracks", stab, "active_track_index", rows=3) |
483 | 475 |
484 sub = row.column(align=True) | 476 sub = row.column(align=True) |
485 | 477 |
486 sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="") | 478 sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="") |
487 sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="") | 479 sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="") |
488 | 480 |
489 sub.menu('CLIP_MT_stabilize_2d_specials', text="", \ | 481 sub.menu('CLIP_MT_stabilize_2d_specials', text="", |
490 icon="DOWNARROW_HLT") | 482 icon="DOWNARROW_HLT") |
491 | 483 |
492 layout.prop(stab, "influence_location") | 484 layout.prop(stab, "influence_location") |
493 | 485 |
494 layout.separator() | 486 layout.separator() |
495 | 487 |
496 layout.prop(stab, "use_autoscale") | 488 layout.prop(stab, "use_autoscale") |
497 col = layout.column() | 489 col = layout.column() |
498 col.active = stab.use_autoscale | 490 col.active = stab.use_autoscale |
499 col.prop(stab, "max_scale") | 491 col.prop(stab, "scale_max") |
500 col.prop(stab, "influence_scale") | 492 col.prop(stab, "influence_scale") |
501 | 493 |
502 layout.separator() | 494 layout.separator() |
503 | 495 |
504 layout.label(text="Rotation:") | 496 layout.label(text="Rotation:") |
505 | 497 |
506 row = layout.row(align=True) | 498 row = layout.row(align=True) |
507 row.prop_search(stab, "rotation_track", tracking, "tracks", text="") | 499 row.prop_search(stab, "rotation_track", tracking, "tracks", text="") |
508 row.operator("clip.stabilize_2d_set_rotation", text="", icon='ZOOMIN') | 500 row.operator("clip.stabilize_2d_set_rotation", text="", icon='ZOOMIN') |
509 | 501 |
(...skipping 12 matching lines...) Expand all Loading... | |
522 def poll(cls, context): | 514 def poll(cls, context): |
523 sc = context.space_data | 515 sc = context.space_data |
524 clip = sc.clip | 516 clip = sc.clip |
525 | 517 |
526 return sc.mode == 'TRACKING' and clip | 518 return sc.mode == 'TRACKING' and clip |
527 | 519 |
528 def draw(self, context): | 520 def draw(self, context): |
529 layout = self.layout | 521 layout = self.layout |
530 sc = context.space_data | 522 sc = context.space_data |
531 clip = context.space_data.clip | 523 clip = context.space_data.clip |
532 act_track = clip.tracking.active_track | 524 act_track = clip.tracking.tracks.active |
533 | 525 |
534 if act_track: | 526 if act_track: |
535 layout.template_marker(sc, "clip", sc.clip_user, act_track, False) | 527 layout.template_marker(sc, "clip", sc.clip_user, act_track, False) |
536 else: | 528 else: |
537 layout.active = False | 529 layout.active = False |
538 layout.label(text="No active track") | 530 layout.label(text="No active track") |
539 | 531 |
540 | 532 |
541 class CLIP_PT_proxy(Panel): | 533 class CLIP_PT_proxy(Panel): |
542 bl_space_type = 'CLIP_EDITOR' | 534 bl_space_type = 'CLIP_EDITOR' |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
617 layout.template_movieclip(sc, "clip", compact=True) | 609 layout.template_movieclip(sc, "clip", compact=True) |
618 else: | 610 else: |
619 layout.operator("clip.open", icon='FILESEL') | 611 layout.operator("clip.open", icon='FILESEL') |
620 | 612 |
621 | 613 |
622 class CLIP_PT_tools_clip(Panel): | 614 class CLIP_PT_tools_clip(Panel): |
623 bl_space_type = 'CLIP_EDITOR' | 615 bl_space_type = 'CLIP_EDITOR' |
624 bl_region_type = 'TOOLS' | 616 bl_region_type = 'TOOLS' |
625 bl_label = "Clip" | 617 bl_label = "Clip" |
626 | 618 |
619 @classmethod | |
620 def poll(cls, context): | |
621 sc = context.space_data | |
622 | |
623 return sc.clip | |
624 | |
627 def draw(self, context): | 625 def draw(self, context): |
628 layout = self.layout | 626 layout = self.layout |
629 clip = context.space_data.clip | 627 clip = context.space_data.clip |
630 | 628 |
631 layout.operator("clip.set_viewport_background") | 629 layout.operator("clip.set_viewport_background") |
632 | 630 |
633 | 631 |
634 class CLIP_MT_view(Menu): | 632 class CLIP_MT_view(Menu): |
635 bl_label = "View" | 633 bl_label = "View" |
636 | 634 |
637 def draw(self, context): | 635 def draw(self, context): |
638 layout = self.layout | 636 layout = self.layout |
639 | 637 |
640 layout.operator("clip.properties", icon='MENU_PANEL') | 638 layout.operator("clip.properties", icon='MENU_PANEL') |
641 layout.operator("clip.tools", icon='MENU_PANEL') | 639 layout.operator("clip.tools", icon='MENU_PANEL') |
642 layout.separator() | 640 layout.separator() |
643 | 641 |
644 layout.operator("clip.view_selected") | 642 layout.operator("clip.view_selected") |
645 layout.operator("clip.view_all") | 643 layout.operator("clip.view_all") |
646 | 644 |
647 layout.separator() | 645 layout.separator() |
648 layout.operator("clip.view_zoom_in") | 646 layout.operator("clip.view_zoom_in") |
649 layout.operator("clip.view_zoom_out") | 647 layout.operator("clip.view_zoom_out") |
650 | 648 |
651 layout.separator() | 649 layout.separator() |
652 | 650 |
653 ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]] | 651 ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1)) |
654 | 652 |
655 for a, b in ratios: | 653 for a, b in ratios: |
656 text = "Zoom %d:%d" % (a, b) | 654 text = "Zoom %d:%d" % (a, b) |
657 layout.operator("clip.view_zoom_ratio", text=text).ratio = a / b | 655 layout.operator("clip.view_zoom_ratio", text=text).ratio = a / b |
658 | 656 |
659 layout.separator() | 657 layout.separator() |
660 layout.operator("screen.area_dupli") | 658 layout.operator("screen.area_dupli") |
661 layout.operator("screen.screen_full_area") | 659 layout.operator("screen.screen_full_area") |
662 | 660 |
663 | 661 |
664 class CLIP_MT_clip(Menu): | 662 class CLIP_MT_clip(Menu): |
665 bl_label = "Clip" | 663 bl_label = "Clip" |
666 | 664 |
667 def draw(self, context): | 665 def draw(self, context): |
668 layout = self.layout | 666 layout = self.layout |
669 | 667 |
670 sc = context.space_data | 668 sc = context.space_data |
671 clip = sc.clip | 669 clip = sc.clip |
672 | 670 |
673 layout.menu("CLIP_MT_proxy") | 671 layout.operator("clip.open") |
674 | 672 |
675 if clip: | 673 if clip: |
676 layout.operator("clip.reload") | 674 layout.operator("clip.reload") |
677 | 675 layout.menu("CLIP_MT_proxy") |
678 layout.operator("clip.open") | |
679 | 676 |
680 | 677 |
681 class CLIP_MT_proxy(Menu): | 678 class CLIP_MT_proxy(Menu): |
682 bl_label = "Proxy" | 679 bl_label = "Proxy" |
683 | 680 |
684 def draw(self, context): | 681 def draw(self, context): |
685 layout = self.layout | 682 layout = self.layout |
686 | 683 |
687 sc = context.space_data | 684 sc = context.space_data |
688 clip = sc.clip | 685 clip = sc.clip |
689 | 686 |
690 layout.operator("clip.rebuild_proxy") | 687 layout.operator("clip.rebuild_proxy") |
691 layout.operator("clip.delete_proxy") | 688 layout.operator("clip.delete_proxy") |
692 | 689 |
693 | 690 |
694 class CLIP_MT_track(Menu): | 691 class CLIP_MT_track(Menu): |
695 bl_label = "Track" | 692 bl_label = "Track" |
696 | 693 |
697 def draw(self, context): | 694 def draw(self, context): |
698 layout = self.layout | 695 layout = self.layout |
699 | 696 |
700 layout.operator("clip.clear_solution") | 697 layout.operator("clip.clear_solution") |
701 layout.operator("clip.solve_camera") | 698 layout.operator("clip.solve_camera") |
702 | 699 |
703 layout.separator() | 700 layout.separator() |
704 op = layout.operator("clip.clear_track_path", text="Clear After") | 701 props = layout.operator("clip.clear_track_path", text="Clear After") |
705 op.action = 'REMAINED' | 702 props.action = 'REMAINED' |
706 | 703 |
707 op = layout.operator("clip.clear_track_path", text="Clear Before") | 704 props = layout.operator("clip.clear_track_path", text="Clear Before") |
708 op.action = 'UPTO' | 705 props.action = 'UPTO' |
709 | 706 |
710 op = layout.operator("clip.clear_track_path", text="Clear Track Path") | 707 props = layout.operator("clip.clear_track_path", text="Clear Track Path" ) |
711 op.action = 'ALL' | 708 props.action = 'ALL' |
712 | 709 |
713 layout.separator() | 710 layout.separator() |
714 layout.operator("clip.join_tracks") | 711 layout.operator("clip.join_tracks") |
715 | 712 |
716 layout.separator() | 713 layout.separator() |
717 layout.operator("clip.clean_tracks") | 714 layout.operator("clip.clean_tracks") |
718 | 715 |
719 layout.separator() | 716 layout.separator() |
720 op = layout.operator("clip.track_markers", \ | 717 props = layout.operator("clip.track_markers", |
721 text="Track Frame Backwards") | 718 text="Track Frame Backwards") |
722 op.backwards = True | 719 props.backwards = True |
723 | 720 |
724 op = layout.operator("clip.track_markers", text="Track Backwards") | 721 props = layout.operator("clip.track_markers", text="Track Backwards") |
725 op.backwards = True | 722 props.backwards = True |
726 op.sequence = True | 723 props.sequence = True |
727 | 724 |
728 op = layout.operator("clip.track_markers", text="Track Forwards") | 725 props = layout.operator("clip.track_markers", text="Track Forwards") |
729 op.sequence = True | 726 props.sequence = True |
730 layout.operator("clip.track_markers", text="Track Frame Forwards") | 727 layout.operator("clip.track_markers", text="Track Frame Forwards") |
731 | 728 |
732 layout.separator() | 729 layout.separator() |
733 layout.operator("clip.delete_track") | 730 layout.operator("clip.delete_track") |
734 layout.operator("clip.delete_marker") | 731 layout.operator("clip.delete_marker") |
735 | 732 |
736 layout.separator() | 733 layout.separator() |
737 layout.operator("clip.add_marker_move") | 734 layout.operator("clip.add_marker_move") |
738 | 735 |
739 layout.separator() | 736 layout.separator() |
(...skipping 23 matching lines...) Expand all Loading... | |
763 | 760 |
764 class CLIP_MT_track_visibility(Menu): | 761 class CLIP_MT_track_visibility(Menu): |
765 bl_label = "Show/Hide" | 762 bl_label = "Show/Hide" |
766 | 763 |
767 def draw(self, context): | 764 def draw(self, context): |
768 layout = self.layout | 765 layout = self.layout |
769 | 766 |
770 layout.operator("clip.hide_tracks_clear", text="Show Hidden") | 767 layout.operator("clip.hide_tracks_clear", text="Show Hidden") |
771 layout.operator("clip.hide_tracks", text="Hide Selected") | 768 layout.operator("clip.hide_tracks", text="Hide Selected") |
772 | 769 |
773 op = layout.operator("clip.hide_tracks", text="Hide Unselected") | 770 props = layout.operator("clip.hide_tracks", text="Hide Unselected") |
774 op.unselected = True | 771 props.unselected = True |
775 | 772 |
776 | 773 |
777 class CLIP_MT_track_transform(Menu): | 774 class CLIP_MT_track_transform(Menu): |
778 bl_label = "Transform" | 775 bl_label = "Transform" |
779 | 776 |
780 def draw(self, context): | 777 def draw(self, context): |
781 layout = self.layout | 778 layout = self.layout |
782 | 779 |
783 layout.operator("transform.translate") | 780 layout.operator("transform.translate") |
784 layout.operator("transform.resize") | 781 layout.operator("transform.resize") |
785 | 782 |
786 | 783 |
787 class CLIP_MT_select(Menu): | 784 class CLIP_MT_select(Menu): |
788 bl_label = "Select" | 785 bl_label = "Select" |
789 | 786 |
790 def draw(self, context): | 787 def draw(self, context): |
791 layout = self.layout | 788 layout = self.layout |
792 | 789 |
793 sc = context.space_data | 790 sc = context.space_data |
794 | 791 |
795 layout.menu("CLIP_MT_select_grouped") | |
796 layout.operator("clip.select_border") | 792 layout.operator("clip.select_border") |
797 layout.operator("clip.select_circle") | 793 layout.operator("clip.select_circle") |
794 | |
795 layout.separator() | |
796 | |
798 layout.operator("clip.select_all", text="Select/Deselect all") | 797 layout.operator("clip.select_all", text="Select/Deselect all") |
799 layout.operator("clip.select_all", text="Inverse").action = 'INVERT' | 798 layout.operator("clip.select_all", text="Inverse").action = 'INVERT' |
800 | 799 |
800 layout.menu("CLIP_MT_select_grouped") | |
801 | |
801 | 802 |
802 class CLIP_MT_select_grouped(Menu): | 803 class CLIP_MT_select_grouped(Menu): |
803 bl_label = "Select Grouped" | 804 bl_label = "Select Grouped" |
804 | 805 |
805 def draw(self, context): | 806 def draw(self, context): |
806 layout = self.layout | 807 layout = self.layout |
807 | 808 |
808 sc = context.space_data | 809 layout.operator_enum("clip.select_grouped", "group") |
809 | |
810 op = layout.operator("clip.select_grouped", text="Select Keyframed") | |
811 op.group = 'KEYFRAMED' | |
812 | |
813 op = layout.operator("clip.select_grouped", text="Select Estimated") | |
814 op.group = 'ESTIMATED' | |
815 | |
816 op = layout.operator("clip.select_grouped", text="Select Tracked") | |
817 op.group = 'TRACKED' | |
818 | |
819 op = layout.operator("clip.select_grouped", text="Select Locked") | |
820 op.group = 'LOCKED' | |
821 | |
822 op = layout.operator("clip.select_grouped", text="Select Disabled") | |
823 op.group = 'DISABLED' | |
824 | |
825 op = layout.operator("clip.select_grouped", text="Select Failed") | |
826 op.group = 'FAILED' | |
827 | |
828 op = layout.operator("clip.select_grouped", text="Select by Color") | |
829 op.group = 'COLOR' | |
830 | 810 |
831 | 811 |
832 class CLIP_MT_tracking_specials(Menu): | 812 class CLIP_MT_tracking_specials(Menu): |
833 bl_label = "Specials" | 813 bl_label = "Specials" |
834 | 814 |
835 @classmethod | 815 @classmethod |
836 def poll(cls, context): | 816 def poll(cls, context): |
837 return context.space_data.clip | 817 return context.space_data.clip |
838 | 818 |
839 def draw(self, context): | 819 def draw(self, context): |
840 layout = self.layout | 820 layout = self.layout |
841 | 821 |
842 op = layout.operator("clip.disable_markers", text="Enable Markers") | 822 props = layout.operator("clip.disable_markers", text="Enable Markers") |
843 op.action = 'ENABLE' | 823 props.action = 'ENABLE' |
844 | 824 |
845 op = layout.operator("clip.disable_markers", text="Disable markers") | 825 props = layout.operator("clip.disable_markers", text="Disable markers") |
846 op.action = 'DISABLE' | 826 props.action = 'DISABLE' |
847 | 827 |
848 layout.separator() | 828 layout.separator() |
849 layout.operator("clip.set_origin") | 829 layout.operator("clip.set_origin") |
850 | 830 |
851 layout.separator() | 831 layout.separator() |
852 layout.operator("clip.hide_tracks") | 832 layout.operator("clip.hide_tracks") |
853 layout.operator("clip.hide_tracks_clear", text="Show Tracks") | 833 layout.operator("clip.hide_tracks_clear", text="Show Tracks") |
854 | 834 |
855 layout.separator() | 835 layout.separator() |
856 op = layout.operator("clip.lock_tracks", text="Lock Tracks") | 836 props = layout.operator("clip.lock_tracks", text="Lock Tracks") |
857 op.action = 'LOCK' | 837 props.action = 'LOCK' |
858 | 838 |
859 op = layout.operator("clip.lock_tracks", text="Unlock Tracks") | 839 props = layout.operator("clip.lock_tracks", text="Unlock Tracks") |
860 op.action = 'UNLOCK' | 840 props.action = 'UNLOCK' |
861 | 841 |
862 | 842 |
863 class CLIP_MT_camera_presets(Menu): | 843 class CLIP_MT_camera_presets(Menu): |
864 bl_label = "Camera Presets" | 844 bl_label = "Camera Presets" |
865 preset_subdir = "tracking_camera" | 845 preset_subdir = "tracking_camera" |
866 preset_operator = "script.execute_preset" | 846 preset_operator = "script.execute_preset" |
867 draw = bpy.types.Menu.draw_preset | 847 draw = bpy.types.Menu.draw_preset |
868 | 848 |
869 | 849 |
870 class CLIP_MT_track_color_presets(Menu): | 850 class CLIP_MT_track_color_presets(Menu): |
(...skipping 13 matching lines...) Expand all Loading... | |
884 | 864 |
885 | 865 |
886 class CLIP_MT_stabilize_2d_specials(Menu): | 866 class CLIP_MT_stabilize_2d_specials(Menu): |
887 bl_label = "Track Color Specials" | 867 bl_label = "Track Color Specials" |
888 | 868 |
889 def draw(self, context): | 869 def draw(self, context): |
890 layout = self.layout | 870 layout = self.layout |
891 | 871 |
892 layout.operator('clip.stabilize_2d_select') | 872 layout.operator('clip.stabilize_2d_select') |
893 | 873 |
894 | |
895 if __name__ == "__main__": # only for live edit. | 874 if __name__ == "__main__": # only for live edit. |
896 bpy.utils.register_module(__name__) | 875 bpy.utils.register_module(__name__) |
897 # ##### BEGIN GPL LICENSE BLOCK ##### | |
898 # | |
899 # This program is free software; you can redistribute it and/or | |
900 # modify it under the terms of the GNU General Public License | |
901 # as published by the Free Software Foundation; either version 2 | |
902 # of the License, or (at your option) any later version. | |
903 # | |
904 # This program is distributed in the hope that it will be useful, | |
905 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
906 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
907 # GNU General Public License for more details. | |
908 # | |
909 # You should have received a copy of the GNU General Public License | |
910 # along with this program; if not, write to the Free Software Foundation, | |
911 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
912 # | |
913 # ##### END GPL LICENSE BLOCK ##### | |
914 | |
915 # <pep8-80 compliant> | |
916 | |
917 import bpy | |
918 from bpy.types import Panel, Header, Menu, UIList | |
919 from bpy.app.translations import pgettext_iface as iface_ | |
920 | |
921 | |
922 class CLIP_UL_tracking_objects(UIList): | |
923 def draw_item(self, context, layout, data, item, icon, | |
924 active_data, active_propname, index): | |
925 # assert(isinstance(item, bpy.types.MovieTrackingObject) | |
926 tobj = item | |
927 if self.layout_type in {'DEFAULT', 'COMPACT'}: | |
928 layout.label(text=tobj.name, translate=False, | |
929 icon='CAMERA_DATA' if tobj.is_camera | |
930 else 'OBJECT_DATA') | |
931 elif self.layout_type in {'GRID'}: | |
932 layout.alignment = 'CENTER' | |
933 layout.label(text="", | |
934 icon='CAMERA_DATA' if tobj.is_camera | |
935 else 'OBJECT_DATA') | |
936 | |
937 | |
938 class CLIP_HT_header(Header): | |
939 bl_space_type = 'CLIP_EDITOR' | |
940 | |
941 def _draw_tracking(self, context): | |
942 layout = self.layout | |
943 | |
944 sc = context.space_data | |
945 clip = sc.clip | |
946 | |
947 row = layout.row(align=True) | |
948 row.template_header() | |
949 | |
950 if context.area.show_menus: | |
951 sub = row.row(align=True) | |
952 sub.menu("CLIP_MT_view") | |
953 | |
954 if sc.view == 'CLIP': | |
955 if clip: | |
956 sub.menu("CLIP_MT_select") | |
957 sub.menu("CLIP_MT_clip") | |
958 sub.menu("CLIP_MT_track") | |
959 sub.menu("CLIP_MT_reconstruction") | |
960 else: | |
961 sub.menu("CLIP_MT_clip") | |
962 | |
963 row = layout.row() | |
964 row.template_ID(sc, "clip", open="clip.open") | |
965 | |
966 if clip: | |
967 tracking = clip.tracking | |
968 active_object = tracking.objects.active | |
969 | |
970 if sc.view == 'CLIP': | |
971 layout.prop(sc, "mode", text="") | |
972 layout.prop(sc, "view", text="", expand=True) | |
973 layout.prop(sc, "pivot_point", text="", icon_only=True) | |
974 | |
975 r = active_object.reconstruction | |
976 | |
977 if r.is_valid and sc.view == 'CLIP': | |
978 layout.label(text="Solve error: %.4f" % | |
979 (r.average_error)) | |
980 elif sc.view == 'GRAPH': | |
981 layout.prop(sc, "view", text="", expand=True) | |
982 | |
983 row = layout.row(align=True) | |
984 row.prop(sc, "show_graph_only_selected", text="") | |
985 row.prop(sc, "show_graph_hidden", text="") | |
986 | |
987 row = layout.row(align=True) | |
988 | |
989 if sc.show_filters: | |
990 row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_DOWN', | |
991 text="Filters") | |
992 | |
993 sub = row.row(align=True) | |
994 sub.active = clip.tracking.reconstruction.is_valid | |
995 sub.prop(sc, "show_graph_frames", icon='SEQUENCE', text="") | |
996 | |
997 row.prop(sc, "show_graph_tracks", icon='ANIM', text="") | |
998 else: | |
999 row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_RIGHT', | |
1000 text="Filters") | |
1001 elif sc.view == 'DOPESHEET': | |
1002 dopesheet = tracking.dopesheet | |
1003 layout.prop(sc, "view", text="", expand=True) | |
1004 | |
1005 row = layout.row(align=True) | |
1006 row.prop(dopesheet, "show_only_selected", text="") | |
1007 row.prop(dopesheet, "show_hidden", text="") | |
1008 | |
1009 row = layout.row(align=True) | |
1010 row.prop(dopesheet, "sort_method", text="") | |
1011 row.prop(dopesheet, "use_invert_sort", | |
1012 text="Invert", toggle=True) | |
1013 else: | |
1014 layout.prop(sc, "view", text="", expand=True) | |
1015 | |
1016 def _draw_masking(self, context): | |
1017 layout = self.layout | |
1018 | |
1019 toolsettings = context.tool_settings | |
1020 sc = context.space_data | |
1021 clip = sc.clip | |
1022 | |
1023 row = layout.row(align=True) | |
1024 row.template_header() | |
1025 | |
1026 if context.area.show_menus: | |
1027 sub = row.row(align=True) | |
1028 sub.menu("CLIP_MT_view") | |
1029 | |
1030 if clip: | |
1031 sub.menu("MASK_MT_select") | |
1032 sub.menu("CLIP_MT_clip") # XXX - remove? | |
1033 sub.menu("MASK_MT_mask") | |
1034 else: | |
1035 sub.menu("CLIP_MT_clip") # XXX - remove? | |
1036 | |
1037 row = layout.row() | |
1038 row.template_ID(sc, "clip", open="clip.open") | |
1039 | |
1040 layout.prop(sc, "mode", text="") | |
1041 | |
1042 row = layout.row() | |
1043 row.template_ID(sc, "mask", new="mask.new") | |
1044 | |
1045 layout.prop(sc, "pivot_point", text="", icon_only=True) | |
1046 | |
1047 row = layout.row(align=True) | |
1048 row.prop(toolsettings, "use_proportional_edit_mask", | |
1049 text="", icon_only=True) | |
1050 if toolsettings.use_proportional_edit_mask: | |
1051 row.prop(toolsettings, "proportional_edit_falloff", | |
1052 text="", icon_only=True) | |
1053 | |
1054 def draw(self, context): | |
1055 layout = self.layout | |
1056 | |
1057 sc = context.space_data | |
1058 | |
1059 if sc.mode in {'TRACKING', 'RECONSTRUCTION', 'DISTORTION'}: | |
1060 self._draw_tracking(context) | |
1061 else: | |
1062 self._draw_masking(context) | |
1063 | |
1064 layout.template_running_jobs() | |
1065 | |
1066 | |
1067 class CLIP_PT_clip_view_panel: | |
1068 | |
1069 @classmethod | |
1070 def poll(cls, context): | |
1071 sc = context.space_data | |
1072 clip = sc.clip | |
1073 | |
1074 return clip and sc.view == 'CLIP' | |
1075 | |
1076 | |
1077 class CLIP_PT_tracking_panel: | |
1078 | |
1079 @classmethod | |
1080 def poll(cls, context): | |
1081 sc = context.space_data | |
1082 clip = sc.clip | |
1083 | |
1084 return clip and sc.mode == 'TRACKING' and sc.view == 'CLIP' | |
1085 | |
1086 | |
1087 class CLIP_PT_reconstruction_panel: | |
1088 | |
1089 @classmethod | |
1090 def poll(cls, context): | |
1091 sc = context.space_data | |
1092 clip = sc.clip | |
1093 | |
1094 return clip and sc.mode == 'RECONSTRUCTION' and sc.view == 'CLIP' | |
1095 | |
1096 | |
1097 class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel): | |
1098 bl_space_type = 'CLIP_EDITOR' | |
1099 bl_region_type = 'TOOLS' | |
1100 bl_label = "Marker" | |
1101 | |
1102 def draw(self, context): | |
1103 layout = self.layout | |
1104 | |
1105 sc = context.space_data | |
1106 clip = sc.clip | |
1107 settings = clip.tracking.settings | |
1108 | |
1109 col = layout.column(align=True) | |
1110 col.operator("clip.add_marker_at_click", text="Add Marker") | |
1111 col.operator("clip.detect_features") | |
1112 col.operator("clip.delete_track") | |
1113 | |
1114 box = layout.box() | |
1115 row = box.row(align=True) | |
1116 row.prop(settings, "show_default_expanded", text="", emboss=False) | |
1117 row.label(text="Tracking Settings") | |
1118 | |
1119 if settings.show_default_expanded: | |
1120 col = box.column() | |
1121 row = col.row(align=True) | |
1122 label = CLIP_MT_tracking_settings_presets.bl_label | |
1123 row.menu('CLIP_MT_tracking_settings_presets', text=label) | |
1124 row.operator("clip.tracking_settings_preset_add", | |
1125 text="", icon='ZOOMIN') | |
1126 row.operator("clip.tracking_settings_preset_add", | |
1127 text="", icon='ZOOMOUT').remove_active = True | |
1128 | |
1129 col.separator() | |
1130 | |
1131 row = col.row(align=True) | |
1132 row.prop(settings, "use_default_red_channel", | |
1133 text="R", toggle=True) | |
1134 row.prop(settings, "use_default_green_channel", | |
1135 text="G", toggle=True) | |
1136 row.prop(settings, "use_default_blue_channel", | |
1137 text="B", toggle=True) | |
1138 | |
1139 col.separator() | |
1140 | |
1141 sub = col.column(align=True) | |
1142 sub.prop(settings, "default_pattern_size") | |
1143 sub.prop(settings, "default_search_size") | |
1144 | |
1145 col.label(text="Tracker:") | |
1146 col.prop(settings, "default_motion_model") | |
1147 col.prop(settings, "use_default_brute") | |
1148 col.prop(settings, "use_default_normalization") | |
1149 col.prop(settings, "use_default_mask") | |
1150 col.prop(settings, "default_correlation_min") | |
1151 | |
1152 col.separator() | |
1153 | |
1154 sub = col.column(align=True) | |
1155 sub.prop(settings, "default_frames_limit") | |
1156 sub.prop(settings, "default_margin") | |
1157 | |
1158 col.label(text="Match:") | |
1159 col.prop(settings, "default_pattern_match", text="") | |
1160 | |
1161 col.separator() | |
1162 col.operator("clip.track_settings_as_default", | |
1163 text="Copy From Active Track") | |
1164 | |
1165 | |
1166 class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel): | |
1167 bl_space_type = 'CLIP_EDITOR' | |
1168 bl_region_type = 'TOOLS' | |
1169 bl_label = "Track" | |
1170 | |
1171 def draw(self, context): | |
1172 layout = self.layout | |
1173 | |
1174 row = layout.row(align=True) | |
1175 | |
1176 props = row.operator("clip.track_markers", text="", icon='FRAME_PREV') | |
1177 props.backwards = True | |
1178 props.sequence = False | |
1179 props = row.operator("clip.track_markers", text="", | |
1180 icon='PLAY_REVERSE') | |
1181 props.backwards = True | |
1182 props.sequence = True | |
1183 props = row.operator("clip.track_markers", text="", icon='PLAY') | |
1184 props.backwards = False | |
1185 props.sequence = True | |
1186 props = row.operator("clip.track_markers", text="", icon='FRAME_NEXT') | |
1187 props.backwards = False | |
1188 props.sequence = False | |
1189 | |
1190 col = layout.column() | |
1191 col.label(text="Refine:") | |
1192 row = col.row(align=True) | |
1193 row.operator("clip.refine_markers", text="Backwards").backwards = True | |
1194 row.operator("clip.refine_markers", text="Forwards").backwards = False | |
1195 | |
1196 col = layout.column() | |
1197 col.label(text="Clear:") | |
1198 row = col.row(align=True) | |
1199 row.operator("clip.clear_track_path", text="Before").action = 'UPTO' | |
1200 row.operator("clip.clear_track_path", text="After").action = 'REMAINED' | |
1201 | |
1202 layout.operator("clip.join_tracks", text="Join") | |
1203 | |
1204 | |
1205 class CLIP_PT_tools_plane_tracking(CLIP_PT_tracking_panel, Panel): | |
1206 bl_space_type = 'CLIP_EDITOR' | |
1207 bl_region_type = 'TOOLS' | |
1208 bl_label = "Plane Track" | |
1209 bl_options = {'DEFAULT_CLOSED'} | |
1210 | |
1211 def draw(self, context): | |
1212 layout = self.layout | |
1213 layout.operator("clip.create_plane_track") | |
1214 | |
1215 | |
1216 class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): | |
1217 bl_space_type = 'CLIP_EDITOR' | |
1218 bl_region_type = 'TOOLS' | |
1219 bl_label = "Solve" | |
1220 | |
1221 def draw(self, context): | |
1222 layout = self.layout | |
1223 | |
1224 clip = context.space_data.clip | |
1225 tracking = clip.tracking | |
1226 settings = tracking.settings | |
1227 tracking_object = tracking.objects.active | |
1228 | |
1229 col = layout.column(align=True) | |
1230 | |
1231 col.operator("clip.solve_camera", | |
1232 text="Camera Motion" if tracking_object.is_camera | |
1233 else "Object Motion") | |
1234 col.operator("clip.clear_solution") | |
1235 | |
1236 col = layout.column() | |
1237 col.prop(settings, "use_tripod_solver") | |
1238 col.prop(settings, "use_keyframe_selection") | |
1239 | |
1240 col = layout.column(align=True) | |
1241 col.active = (not settings.use_tripod_solver and | |
1242 not settings.use_keyframe_selection) | |
1243 col.prop(tracking_object, "keyframe_a") | |
1244 col.prop(tracking_object, "keyframe_b") | |
1245 | |
1246 col = layout.column(align=True) | |
1247 col.active = tracking_object.is_camera | |
1248 col.label(text="Refine:") | |
1249 col.prop(settings, "refine_intrinsics", text="") | |
1250 | |
1251 | |
1252 class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel): | |
1253 bl_space_type = 'CLIP_EDITOR' | |
1254 bl_region_type = 'TOOLS' | |
1255 bl_label = "Clean up" | |
1256 | |
1257 def draw(self, context): | |
1258 layout = self.layout | |
1259 clip = context.space_data.clip | |
1260 settings = clip.tracking.settings | |
1261 | |
1262 layout.operator("clip.clean_tracks") | |
1263 | |
1264 layout.prop(settings, "clean_frames", text="Frames") | |
1265 layout.prop(settings, "clean_error", text="Error") | |
1266 layout.prop(settings, "clean_action", text="") | |
1267 | |
1268 | |
1269 class CLIP_PT_tools_geometry(CLIP_PT_reconstruction_panel, Panel): | |
1270 bl_space_type = 'CLIP_EDITOR' | |
1271 bl_region_type = 'TOOLS' | |
1272 bl_label = "Geometry" | |
1273 | |
1274 def draw(self, context): | |
1275 layout = self.layout | |
1276 | |
1277 layout.operator("clip.bundles_to_mesh") | |
1278 layout.operator("clip.track_to_empty") | |
1279 | |
1280 | |
1281 class CLIP_PT_tools_orientation(CLIP_PT_reconstruction_panel, Panel): | |
1282 bl_space_type = 'CLIP_EDITOR' | |
1283 bl_region_type = 'TOOLS' | |
1284 bl_label = "Orientation" | |
1285 | |
1286 def draw(self, context): | |
1287 sc = context.space_data | |
1288 layout = self.layout | |
1289 settings = sc.clip.tracking.settings | |
1290 | |
1291 col = layout.column(align=True) | |
1292 row = col.row(align=True) | |
1293 row.operator("clip.set_plane", text="Floor").plane = 'FLOOR' | |
1294 row.operator("clip.set_plane", text="Wall").plane = 'WALL' | |
1295 | |
1296 col.operator("clip.set_origin") | |
1297 | |
1298 row = col.row(align=True) | |
1299 row.operator("clip.set_axis", text="Set X Axis").axis = 'X' | |
1300 row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y' | |
1301 | |
1302 layout.separator() | |
1303 | |
1304 col = layout.column() | |
1305 row = col.row(align=True) | |
1306 row.operator("clip.set_scale") | |
1307 row.operator("clip.apply_solution_scale", text="Apply Scale") | |
1308 | |
1309 col.prop(settings, "distance") | |
1310 | |
1311 | |
1312 class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel): | |
1313 bl_space_type = 'CLIP_EDITOR' | |
1314 bl_region_type = 'TOOLS' | |
1315 bl_label = "Object" | |
1316 | |
1317 @classmethod | |
1318 def poll(cls, context): | |
1319 if CLIP_PT_reconstruction_panel.poll(context): | |
1320 sc = context.space_data | |
1321 clip = sc.clip | |
1322 | |
1323 tracking_object = clip.tracking.objects.active | |
1324 | |
1325 return not tracking_object.is_camera | |
1326 | |
1327 return False | |
1328 | |
1329 def draw(self, context): | |
1330 layout = self.layout | |
1331 | |
1332 sc = context.space_data | |
1333 clip = sc.clip | |
1334 tracking_object = clip.tracking.objects.active | |
1335 settings = sc.clip.tracking.settings | |
1336 | |
1337 col = layout.column() | |
1338 | |
1339 col.prop(tracking_object, "scale") | |
1340 | |
1341 col.separator() | |
1342 | |
1343 col.operator("clip.set_solution_scale", text="Set Scale") | |
1344 col.prop(settings, "object_distance") | |
1345 | |
1346 | |
1347 class CLIP_PT_tools_grease_pencil(Panel): | |
1348 bl_space_type = 'CLIP_EDITOR' | |
1349 bl_region_type = 'TOOLS' | |
1350 bl_label = "Grease Pencil" | |
1351 | |
1352 @classmethod | |
1353 def poll(cls, context): | |
1354 sc = context.space_data | |
1355 clip = sc.clip | |
1356 | |
1357 if not clip: | |
1358 return False | |
1359 | |
1360 if sc.mode == 'DISTORTION': | |
1361 return sc.view == 'CLIP' | |
1362 elif sc.mode == 'MASK': | |
1363 return True | |
1364 | |
1365 return False | |
1366 | |
1367 def draw(self, context): | |
1368 layout = self.layout | |
1369 | |
1370 col = layout.column(align=True) | |
1371 | |
1372 row = col.row(align=True) | |
1373 row.operator("gpencil.draw", text="Draw").mode = 'DRAW' | |
1374 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT' | |
1375 | |
1376 row = col.row(align=True) | |
1377 row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY' | |
1378 row.operator("gpencil.draw", text="Erase").mode = 'ERASER' | |
1379 | |
1380 row = col.row(align=True) | |
1381 row.prop(context.tool_settings, "use_grease_pencil_sessions") | |
1382 | |
1383 | |
1384 class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel): | |
1385 bl_space_type = 'CLIP_EDITOR' | |
1386 bl_region_type = 'UI' | |
1387 bl_label = "Objects" | |
1388 bl_options = {'DEFAULT_CLOSED'} | |
1389 | |
1390 def draw(self, context): | |
1391 layout = self.layout | |
1392 | |
1393 sc = context.space_data | |
1394 tracking = sc.clip.tracking | |
1395 | |
1396 row = layout.row() | |
1397 row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects", | |
1398 tracking, "active_object_index", rows=1) | |
1399 | |
1400 sub = row.column(align=True) | |
1401 | |
1402 sub.operator("clip.tracking_object_new", icon='ZOOMIN', text="") | |
1403 sub.operator("clip.tracking_object_remove", icon='ZOOMOUT', text="") | |
1404 | |
1405 active = tracking.objects.active | |
1406 if active: | |
1407 layout.prop(active, "name") | |
1408 | |
1409 | |
1410 class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): | |
1411 bl_space_type = 'CLIP_EDITOR' | |
1412 bl_region_type = 'UI' | |
1413 bl_label = "Track" | |
1414 | |
1415 def draw(self, context): | |
1416 layout = self.layout | |
1417 | |
1418 sc = context.space_data | |
1419 clip = context.space_data.clip | |
1420 act_track = clip.tracking.tracks.active | |
1421 | |
1422 if not act_track: | |
1423 layout.active = False | |
1424 layout.label(text="No active track") | |
1425 return | |
1426 | |
1427 row = layout.row() | |
1428 row.prop(act_track, "name", text="") | |
1429 | |
1430 sub = row.row(align=True) | |
1431 | |
1432 sub.template_marker(sc, "clip", sc.clip_user, act_track, True) | |
1433 | |
1434 icon = 'LOCKED' if act_track.lock else 'UNLOCKED' | |
1435 sub.prop(act_track, "lock", text="", icon=icon) | |
1436 | |
1437 layout.template_track(sc, "scopes") | |
1438 | |
1439 row = layout.row(align=True) | |
1440 sub = row.row(align=True) | |
1441 sub.prop(act_track, "use_red_channel", text="R", toggle=True) | |
1442 sub.prop(act_track, "use_green_channel", text="G", toggle=True) | |
1443 sub.prop(act_track, "use_blue_channel", text="B", toggle=True) | |
1444 | |
1445 row.separator() | |
1446 | |
1447 row.prop(act_track, "use_grayscale_preview", text="B/W", toggle=True) | |
1448 | |
1449 row.separator() | |
1450 row.prop(act_track, "use_alpha_preview", | |
1451 text="", toggle=True, icon='IMAGE_ALPHA') | |
1452 | |
1453 layout.separator() | |
1454 | |
1455 row = layout.row(align=True) | |
1456 label = bpy.types.CLIP_MT_track_color_presets.bl_label | |
1457 row.menu('CLIP_MT_track_color_presets', text=label) | |
1458 row.menu('CLIP_MT_track_color_specials', text="", icon='DOWNARROW_HLT') | |
1459 row.operator("clip.track_color_preset_add", text="", icon='ZOOMIN') | |
1460 row.operator("clip.track_color_preset_add", | |
1461 text="", icon='ZOOMOUT').remove_active = True | |
1462 | |
1463 row = layout.row() | |
1464 row.prop(act_track, "use_custom_color") | |
1465 if act_track.use_custom_color: | |
1466 row.prop(act_track, "color", text="") | |
1467 | |
1468 layout.prop(act_track, "weight") | |
1469 | |
1470 if act_track.has_bundle: | |
1471 label_text = "Average Error: %.4f" % (act_track.average_error) | |
1472 layout.label(text=label_text) | |
1473 | |
1474 | |
1475 class CLIP_PT_plane_track(CLIP_PT_tracking_panel, Panel): | |
1476 bl_space_type = 'CLIP_EDITOR' | |
1477 bl_region_type = 'UI' | |
1478 bl_label = "Plane Track" | |
1479 bl_options = {'DEFAULT_CLOSED'} | |
1480 | |
1481 def draw(self, context): | |
1482 layout = self.layout | |
1483 | |
1484 sc = context.space_data | |
1485 clip = context.space_data.clip | |
1486 active_track = clip.tracking.plane_tracks.active | |
1487 | |
1488 if not active_track: | |
1489 layout.active = False | |
1490 layout.label(text="No active plane track") | |
1491 return | |
1492 | |
1493 layout.prop(active_track, "name") | |
1494 layout.prop(active_track, "use_auto_keying") | |
1495 | |
1496 | |
1497 class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel): | |
1498 bl_space_type = 'CLIP_EDITOR' | |
1499 bl_region_type = 'UI' | |
1500 bl_label = "Tracking Settings" | |
1501 bl_options = {'DEFAULT_CLOSED'} | |
1502 | |
1503 def draw(self, context): | |
1504 layout = self.layout | |
1505 | |
1506 clip = context.space_data.clip | |
1507 settings = clip.tracking.settings | |
1508 | |
1509 col = layout.column() | |
1510 | |
1511 active = clip.tracking.tracks.active | |
1512 if active: | |
1513 col.prop(active, "motion_model") | |
1514 col.prop(active, "use_brute") | |
1515 col.prop(active, "use_normalization") | |
1516 col.prop(active, "use_mask") | |
1517 col.prop(active, "correlation_min") | |
1518 | |
1519 col.separator() | |
1520 col.prop(active, "frames_limit") | |
1521 col.prop(active, "margin") | |
1522 col.prop(active, "pattern_match", text="Match") | |
1523 | |
1524 col.prop(settings, "speed") | |
1525 | |
1526 | |
1527 class CLIP_PT_tracking_camera(Panel): | |
1528 bl_space_type = 'CLIP_EDITOR' | |
1529 bl_region_type = 'UI' | |
1530 bl_label = "Camera Data" | |
1531 bl_options = {'DEFAULT_CLOSED'} | |
1532 | |
1533 @classmethod | |
1534 def poll(cls, context): | |
1535 if CLIP_PT_clip_view_panel.poll(context): | |
1536 sc = context.space_data | |
1537 | |
1538 return sc.mode in {'TRACKING', 'DISTORTION'} and sc.clip | |
1539 | |
1540 return False | |
1541 | |
1542 def draw(self, context): | |
1543 layout = self.layout | |
1544 | |
1545 sc = context.space_data | |
1546 clip = sc.clip | |
1547 | |
1548 row = layout.row(align=True) | |
1549 label = bpy.types.CLIP_MT_camera_presets.bl_label | |
1550 row.menu('CLIP_MT_camera_presets', text=label) | |
1551 row.operator("clip.camera_preset_add", text="", icon='ZOOMIN') | |
1552 row.operator("clip.camera_preset_add", text="", | |
1553 icon='ZOOMOUT').remove_active = True | |
1554 | |
1555 row = layout.row(align=True) | |
1556 sub = row.split(percentage=0.65, align=True) | |
1557 if clip.tracking.camera.units == 'MILLIMETERS': | |
1558 sub.prop(clip.tracking.camera, "focal_length") | |
1559 else: | |
1560 sub.prop(clip.tracking.camera, "focal_length_pixels") | |
1561 sub.prop(clip.tracking.camera, "units", text="") | |
1562 | |
1563 col = layout.column(align=True) | |
1564 col.label(text="Sensor:") | |
1565 col.prop(clip.tracking.camera, "sensor_width", text="Width") | |
1566 col.prop(clip.tracking.camera, "pixel_aspect") | |
1567 | |
1568 col = layout.column() | |
1569 col.label(text="Optical Center:") | |
1570 row = col.row() | |
1571 row.prop(clip.tracking.camera, "principal", text="") | |
1572 col.operator("clip.set_center_principal", text="Center") | |
1573 | |
1574 col = layout.column(align=True) | |
1575 col.label(text="Lens Distortion:") | |
1576 col.prop(clip.tracking.camera, "k1") | |
1577 col.prop(clip.tracking.camera, "k2") | |
1578 col.prop(clip.tracking.camera, "k3") | |
1579 | |
1580 | |
1581 class CLIP_PT_display(CLIP_PT_clip_view_panel, Panel): | |
1582 bl_space_type = 'CLIP_EDITOR' | |
1583 bl_region_type = 'UI' | |
1584 bl_label = "Display" | |
1585 | |
1586 def draw(self, context): | |
1587 layout = self.layout | |
1588 sc = context.space_data | |
1589 | |
1590 row = layout.row(align=True) | |
1591 sub = row.row(align=True) | |
1592 sub.prop(sc, "show_red_channel", text="R", toggle=True) | |
1593 sub.prop(sc, "show_green_channel", text="G", toggle=True) | |
1594 sub.prop(sc, "show_blue_channel", text="B", toggle=True) | |
1595 | |
1596 row.separator() | |
1597 | |
1598 row.prop(sc, "use_grayscale_preview", text="B/W", toggle=True) | |
1599 | |
1600 col = layout.column(align=True) | |
1601 | |
1602 col.prop(sc, "show_disabled", "Disabled Tracks") | |
1603 col.prop(sc, "show_names", text="Names and Status") | |
1604 if sc.mode != 'MASK': | |
1605 col.prop(sc, "show_bundles", text="3D Markers") | |
1606 | |
1607 col.prop(sc, "use_mute_footage", text="Mute Footage") | |
1608 col.prop(sc, "lock_selection") | |
1609 | |
1610 if sc.view == 'GRAPH': | |
1611 col.prop(sc, "lock_time_cursor") | |
1612 | |
1613 if sc.mode == 'DISTORTION': | |
1614 col.prop(sc, "show_grid", text="Grid") | |
1615 col.prop(sc, "use_manual_calibration") | |
1616 elif sc.mode == 'RECONSTRUCTION': | |
1617 col.prop(sc, "show_stable", text="Stable") | |
1618 | |
1619 clip = sc.clip | |
1620 if clip: | |
1621 col.label(text="Display Aspect Ratio:") | |
1622 row = col.row() | |
1623 row.prop(clip, "display_aspect", text="") | |
1624 | |
1625 | |
1626 class CLIP_PT_marker_display(CLIP_PT_clip_view_panel, Panel): | |
1627 bl_space_type = 'CLIP_EDITOR' | |
1628 bl_region_type = 'UI' | |
1629 bl_label = "Marker Display" | |
1630 | |
1631 @classmethod | |
1632 def poll(cls, context): | |
1633 sc = context.space_data | |
1634 | |
1635 return sc.mode != 'MASK' | |
1636 | |
1637 def draw(self, context): | |
1638 layout = self.layout | |
1639 sc = context.space_data | |
1640 | |
1641 col = layout.column(align=True) | |
1642 | |
1643 row = col.row(align=True) | |
1644 row.prop(sc, "show_marker_pattern", text="Pattern") | |
1645 row.prop(sc, "show_marker_search", text="Search") | |
1646 | |
1647 col.prop(sc, "show_tiny_markers", text="Thin Markers") | |
1648 col.prop(sc, "show_track_path", text="Path") | |
1649 | |
1650 row = col.row(align=True) | |
1651 row.active = sc.show_track_path | |
1652 row.prop(sc, "path_length", text="Length") | |
1653 | |
1654 | |
1655 class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel): | |
1656 bl_space_type = 'CLIP_EDITOR' | |
1657 bl_region_type = 'UI' | |
1658 bl_label = "2D Stabilization" | |
1659 bl_options = {'DEFAULT_CLOSED'} | |
1660 | |
1661 def draw_header(self, context): | |
1662 stab = context.space_data.clip.tracking.stabilization | |
1663 | |
1664 self.layout.prop(stab, "use_2d_stabilization", text="") | |
1665 | |
1666 def draw(self, context): | |
1667 layout = self.layout | |
1668 | |
1669 tracking = context.space_data.clip.tracking | |
1670 stab = tracking.stabilization | |
1671 | |
1672 layout.active = stab.use_2d_stabilization | |
1673 | |
1674 row = layout.row() | |
1675 row.template_list("UI_UL_list", "stabilization_tracks", stab, "tracks", | |
1676 stab, "active_track_index", rows=2) | |
1677 | |
1678 sub = row.column(align=True) | |
1679 | |
1680 sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="") | |
1681 sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="") | |
1682 | |
1683 sub.menu('CLIP_MT_stabilize_2d_specials', text="", | |
1684 icon='DOWNARROW_HLT') | |
1685 | |
1686 layout.prop(stab, "influence_location") | |
1687 | |
1688 layout.prop(stab, "use_autoscale") | |
1689 col = layout.column() | |
1690 col.active = stab.use_autoscale | |
1691 col.prop(stab, "scale_max") | |
1692 col.prop(stab, "influence_scale") | |
1693 | |
1694 layout.prop(stab, "use_stabilize_rotation") | |
1695 col = layout.column() | |
1696 col.active = stab.use_stabilize_rotation | |
1697 | |
1698 row = col.row(align=True) | |
1699 row.prop_search(stab, "rotation_track", tracking, "tracks", text="") | |
1700 row.operator("clip.stabilize_2d_set_rotation", text="", icon='ZOOMIN') | |
1701 | |
1702 row = col.row() | |
1703 row.active = stab.rotation_track is not None | |
1704 row.prop(stab, "influence_rotation") | |
1705 | |
1706 layout.prop(stab, "filter_type") | |
1707 | |
1708 | |
1709 class CLIP_PT_marker(CLIP_PT_tracking_panel, Panel): | |
1710 bl_space_type = 'CLIP_EDITOR' | |
1711 bl_region_type = 'UI' | |
1712 bl_label = "Marker" | |
1713 bl_options = {'DEFAULT_CLOSED'} | |
1714 | |
1715 def draw(self, context): | |
1716 layout = self.layout | |
1717 sc = context.space_data | |
1718 clip = context.space_data.clip | |
1719 act_track = clip.tracking.tracks.active | |
1720 | |
1721 if act_track: | |
1722 layout.template_marker(sc, "clip", sc.clip_user, act_track, False) | |
1723 else: | |
1724 layout.active = False | |
1725 layout.label(text="No active track") | |
1726 | |
1727 | |
1728 class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel): | |
1729 bl_space_type = 'CLIP_EDITOR' | |
1730 bl_region_type = 'UI' | |
1731 bl_label = "Proxy / Timecode" | |
1732 bl_options = {'DEFAULT_CLOSED'} | |
1733 | |
1734 def draw_header(self, context): | |
1735 sc = context.space_data | |
1736 | |
1737 self.layout.prop(sc.clip, "use_proxy", text="") | |
1738 | |
1739 def draw(self, context): | |
1740 layout = self.layout | |
1741 | |
1742 sc = context.space_data | |
1743 clip = sc.clip | |
1744 | |
1745 col = layout.column() | |
1746 col.active = clip.use_proxy | |
1747 | |
1748 col.label(text="Build Original:") | |
1749 | |
1750 row = col.row(align=True) | |
1751 row.prop(clip.proxy, "build_25", toggle=True) | |
1752 row.prop(clip.proxy, "build_50", toggle=True) | |
1753 row.prop(clip.proxy, "build_75", toggle=True) | |
1754 row.prop(clip.proxy, "build_100", toggle=True) | |
1755 | |
1756 col.label(text="Build Undistorted:") | |
1757 | |
1758 row = col.row(align=True) | |
1759 row.prop(clip.proxy, "build_undistorted_25", toggle=True) | |
1760 row.prop(clip.proxy, "build_undistorted_50", toggle=True) | |
1761 row.prop(clip.proxy, "build_undistorted_75", toggle=True) | |
1762 row.prop(clip.proxy, "build_undistorted_100", toggle=True) | |
1763 | |
1764 col.prop(clip.proxy, "quality") | |
1765 | |
1766 col.prop(clip, "use_proxy_custom_directory") | |
1767 if clip.use_proxy_custom_directory: | |
1768 col.prop(clip.proxy, "directory") | |
1769 | |
1770 col.operator("clip.rebuild_proxy", text="Build Proxy") | |
1771 | |
1772 if clip.source == 'MOVIE': | |
1773 col2 = col.column() | |
1774 | |
1775 col2.label(text="Use timecode index:") | |
1776 col2.prop(clip.proxy, "timecode", text="") | |
1777 | |
1778 col2 = col.column() | |
1779 col2.label(text="Proxy render size:") | |
1780 | |
1781 col.prop(sc.clip_user, "proxy_render_size", text="") | |
1782 | |
1783 col = layout.column() | |
1784 col.prop(sc.clip_user, "use_render_undistorted") | |
1785 | |
1786 | |
1787 class CLIP_PT_footage(CLIP_PT_clip_view_panel, Panel): | |
1788 bl_space_type = 'CLIP_EDITOR' | |
1789 bl_region_type = 'UI' | |
1790 bl_label = "Footage Settings" | |
1791 bl_options = {'DEFAULT_CLOSED'} | |
1792 | |
1793 def draw(self, context): | |
1794 layout = self.layout | |
1795 | |
1796 sc = context.space_data | |
1797 clip = sc.clip | |
1798 | |
1799 col = layout.column() | |
1800 col.template_movieclip(sc, "clip", compact=True) | |
1801 col.prop(clip, "frame_start") | |
1802 col.prop(clip, "frame_offset") | |
1803 | |
1804 | |
1805 class CLIP_PT_footage_info(CLIP_PT_clip_view_panel, Panel): | |
1806 bl_space_type = 'CLIP_EDITOR' | |
1807 bl_region_type = 'UI' | |
1808 bl_label = "Footage Information" | |
1809 bl_options = {'DEFAULT_CLOSED'} | |
1810 | |
1811 def draw(self, context): | |
1812 layout = self.layout | |
1813 | |
1814 sc = context.space_data | |
1815 clip = sc.clip | |
1816 | |
1817 col = layout.column() | |
1818 col.template_movieclip_information(sc, "clip", sc.clip_user) | |
1819 | |
1820 | |
1821 class CLIP_PT_tools_clip(CLIP_PT_clip_view_panel, Panel): | |
1822 bl_space_type = 'CLIP_EDITOR' | |
1823 bl_region_type = 'TOOLS' | |
1824 bl_label = "Clip" | |
1825 bl_translation_context = bpy.app.translations.contexts.id_movieclip | |
1826 | |
1827 def draw(self, context): | |
1828 layout = self.layout | |
1829 | |
1830 layout.operator("clip.set_viewport_background") | |
1831 layout.operator("clip.setup_tracking_scene") | |
1832 layout.operator("clip.prefetch") | |
1833 layout.operator("clip.set_scene_frames") | |
1834 | |
1835 | |
1836 class CLIP_MT_view(Menu): | |
1837 bl_label = "View" | |
1838 | |
1839 def draw(self, context): | |
1840 layout = self.layout | |
1841 | |
1842 sc = context.space_data | |
1843 | |
1844 if sc.view == 'CLIP': | |
1845 layout.operator("clip.properties", icon='MENU_PANEL') | |
1846 layout.operator("clip.tools", icon='MENU_PANEL') | |
1847 layout.separator() | |
1848 | |
1849 layout.operator("clip.view_selected") | |
1850 layout.operator("clip.view_all") | |
1851 | |
1852 layout.separator() | |
1853 layout.operator("clip.view_zoom_in") | |
1854 layout.operator("clip.view_zoom_out") | |
1855 | |
1856 layout.separator() | |
1857 | |
1858 ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1)) | |
1859 | |
1860 text = iface_("Zoom %d:%d") | |
1861 for a, b in ratios: | |
1862 layout.operator("clip.view_zoom_ratio", | |
1863 text=text % (a, b), | |
1864 translate=False).ratio = a / b | |
1865 else: | |
1866 if sc.view == 'GRAPH': | |
1867 layout.operator_context = 'INVOKE_REGION_PREVIEW' | |
1868 layout.operator("clip.graph_center_current_frame") | |
1869 layout.operator("clip.graph_view_all") | |
1870 layout.operator_context = 'INVOKE_DEFAULT' | |
1871 | |
1872 layout.prop(sc, "show_seconds") | |
1873 layout.separator() | |
1874 | |
1875 layout.separator() | |
1876 layout.operator("screen.area_dupli") | |
1877 layout.operator("screen.screen_full_area") | |
1878 | |
1879 | |
1880 class CLIP_MT_clip(Menu): | |
1881 bl_label = "Clip" | |
1882 bl_translation_context = bpy.app.translations.contexts.id_movieclip | |
1883 | |
1884 def draw(self, context): | |
1885 layout = self.layout | |
1886 | |
1887 sc = context.space_data | |
1888 clip = sc.clip | |
1889 | |
1890 layout.operator("clip.open") | |
1891 | |
1892 if clip: | |
1893 layout.operator("clip.prefetch") | |
1894 layout.operator("clip.reload") | |
1895 layout.menu("CLIP_MT_proxy") | |
1896 | |
1897 | |
1898 class CLIP_MT_proxy(Menu): | |
1899 bl_label = "Proxy" | |
1900 | |
1901 def draw(self, context): | |
1902 layout = self.layout | |
1903 | |
1904 layout.operator("clip.rebuild_proxy") | |
1905 layout.operator("clip.delete_proxy") | |
1906 | |
1907 | |
1908 class CLIP_MT_track(Menu): | |
1909 bl_label = "Track" | |
1910 | |
1911 def draw(self, context): | |
1912 layout = self.layout | |
1913 | |
1914 layout.operator("clip.clear_solution") | |
1915 layout.operator("clip.solve_camera") | |
1916 | |
1917 layout.separator() | |
1918 layout.operator("clip.clear_track_path", | |
1919 text="Clear After").action = 'REMAINED' | |
1920 | |
1921 layout.operator("clip.clear_track_path", | |
1922 text="Clear Before").action = 'UPTO' | |
1923 | |
1924 layout.operator("clip.clear_track_path", | |
1925 text="Clear Track Path").action = 'ALL' | |
1926 | |
1927 layout.separator() | |
1928 layout.operator("clip.join_tracks") | |
1929 | |
1930 layout.separator() | |
1931 layout.operator("clip.clean_tracks") | |
1932 | |
1933 layout.separator() | |
1934 layout.operator("clip.copy_tracks") | |
1935 layout.operator("clip.paste_tracks") | |
1936 | |
1937 layout.separator() | |
1938 layout.operator("clip.track_markers", | |
1939 text="Track Frame Backwards").backwards = True | |
1940 | |
1941 props = layout.operator("clip.track_markers", text="Track Backwards") | |
1942 props.backwards = True | |
1943 props.sequence = True | |
1944 | |
1945 layout.operator("clip.track_markers", | |
1946 text="Track Forwards").sequence = True | |
1947 layout.operator("clip.track_markers", text="Track Frame Forwards") | |
1948 | |
1949 layout.separator() | |
1950 layout.operator("clip.delete_track") | |
1951 layout.operator("clip.delete_marker") | |
1952 | |
1953 layout.separator() | |
1954 layout.operator("clip.add_marker_move") | |
1955 | |
1956 layout.separator() | |
1957 layout.menu("CLIP_MT_track_visibility") | |
1958 layout.menu("CLIP_MT_track_transform") | |
1959 | |
1960 | |
1961 class CLIP_MT_reconstruction(Menu): | |
1962 bl_label = "Reconstruction" | |
1963 | |
1964 def draw(self, context): | |
1965 layout = self.layout | |
1966 | |
1967 layout.operator("clip.set_origin") | |
1968 layout.operator("clip.set_plane", text="Set Floor").plane = 'FLOOR' | |
1969 layout.operator("clip.set_plane", text="Set Wall").plane = 'WALL' | |
1970 | |
1971 layout.operator("clip.set_axis", text="Set X Axis").axis = "X" | |
1972 layout.operator("clip.set_axis", text="Set Y Axis").axis = "Y" | |
1973 | |
1974 layout.operator("clip.set_scale") | |
1975 | |
1976 layout.separator() | |
1977 | |
1978 layout.operator("clip.track_to_empty") | |
1979 layout.operator("clip.bundles_to_mesh") | |
1980 | |
1981 | |
1982 class CLIP_MT_track_visibility(Menu): | |
1983 bl_label = "Show/Hide" | |
1984 | |
1985 def draw(self, context): | |
1986 layout = self.layout | |
1987 | |
1988 layout.operator("clip.hide_tracks_clear", text="Show Hidden") | |
1989 layout.operator("clip.hide_tracks", text="Hide Selected") | |
1990 | |
1991 layout.operator("clip.hide_tracks", | |
1992 text="Hide Unselected").unselected = True | |
1993 | |
1994 | |
1995 class CLIP_MT_track_transform(Menu): | |
1996 bl_label = "Transform" | |
1997 | |
1998 def draw(self, context): | |
1999 layout = self.layout | |
2000 | |
2001 layout.operator("transform.translate") | |
2002 layout.operator("transform.resize") | |
2003 | |
2004 | |
2005 class CLIP_MT_select(Menu): | |
2006 bl_label = "Select" | |
2007 | |
2008 def draw(self, context): | |
2009 layout = self.layout | |
2010 | |
2011 layout.operator("clip.select_border") | |
2012 layout.operator("clip.select_circle") | |
2013 | |
2014 layout.separator() | |
2015 | |
2016 layout.operator("clip.select_all" | |
2017 ).action = 'TOGGLE' | |
2018 layout.operator("clip.select_all", | |
2019 text="Inverse").action = 'INVERT' | |
2020 | |
2021 layout.menu("CLIP_MT_select_grouped") | |
2022 | |
2023 | |
2024 class CLIP_MT_select_grouped(Menu): | |
2025 bl_label = "Select Grouped" | |
2026 | |
2027 def draw(self, context): | |
2028 layout = self.layout | |
2029 | |
2030 layout.operator_enum("clip.select_grouped", "group") | |
2031 | |
2032 | |
2033 class CLIP_MT_tracking_specials(Menu): | |
2034 bl_label = "Specials" | |
2035 | |
2036 @classmethod | |
2037 def poll(cls, context): | |
2038 return context.space_data.clip | |
2039 | |
2040 def draw(self, context): | |
2041 layout = self.layout | |
2042 | |
2043 layout.operator("clip.disable_markers", | |
2044 text="Enable Markers").action = 'ENABLE' | |
2045 | |
2046 layout.operator("clip.disable_markers", | |
2047 text="Disable markers").action = 'DISABLE' | |
2048 | |
2049 layout.separator() | |
2050 layout.operator("clip.set_origin") | |
2051 | |
2052 layout.separator() | |
2053 layout.operator("clip.hide_tracks") | |
2054 layout.operator("clip.hide_tracks_clear", text="Show Tracks") | |
2055 | |
2056 layout.separator() | |
2057 layout.operator("clip.lock_tracks", text="Lock Tracks").action = 'LOCK' | |
2058 | |
2059 layout.operator("clip.lock_tracks", | |
2060 text="Unlock Tracks").action = 'UNLOCK' | |
2061 | |
2062 | |
2063 class CLIP_MT_select_mode(Menu): | |
2064 bl_label = "Select Mode" | |
2065 | |
2066 def draw(self, context): | |
2067 layout = self.layout | |
2068 | |
2069 layout.operator_context = 'INVOKE_REGION_WIN' | |
2070 | |
2071 layout.operator_enum("clip.mode_set", "mode") | |
2072 | |
2073 | |
2074 class CLIP_MT_camera_presets(Menu): | |
2075 """Predefined tracking camera intrinsics""" | |
2076 bl_label = "Camera Presets" | |
2077 preset_subdir = "tracking_camera" | |
2078 preset_operator = "script.execute_preset" | |
2079 draw = Menu.draw_preset | |
2080 | |
2081 | |
2082 class CLIP_MT_track_color_presets(Menu): | |
2083 """Predefined track color""" | |
2084 bl_label = "Color Presets" | |
2085 preset_subdir = "tracking_track_color" | |
2086 preset_operator = "script.execute_preset" | |
2087 draw = Menu.draw_preset | |
2088 | |
2089 | |
2090 class CLIP_MT_tracking_settings_presets(Menu): | |
2091 """Predefined tracking settings""" | |
2092 bl_label = "Tracking Presets" | |
2093 preset_subdir = "tracking_settings" | |
2094 preset_operator = "script.execute_preset" | |
2095 draw = Menu.draw_preset | |
2096 | |
2097 | |
2098 class CLIP_MT_track_color_specials(Menu): | |
2099 bl_label = "Track Color Specials" | |
2100 | |
2101 def draw(self, context): | |
2102 layout = self.layout | |
2103 | |
2104 layout.operator("clip.track_copy_color", icon='COPY_ID') | |
2105 | |
2106 | |
2107 class CLIP_MT_stabilize_2d_specials(Menu): | |
2108 bl_label = "Track Color Specials" | |
2109 | |
2110 def draw(self, context): | |
2111 layout = self.layout | |
2112 | |
2113 layout.operator("clip.stabilize_2d_select") | |
2114 | |
2115 | |
2116 # ----------------------------------------------------------------------------- | |
2117 # Mask (similar code in space_image.py, keep in sync) | |
2118 | |
2119 | |
2120 from bl_ui.properties_mask_common import (MASK_PT_mask, | |
2121 MASK_PT_layers, | |
2122 MASK_PT_spline, | |
2123 MASK_PT_point, | |
2124 MASK_PT_display, | |
2125 MASK_PT_tools) | |
2126 | |
2127 | |
2128 class CLIP_PT_mask(MASK_PT_mask, Panel): | |
2129 bl_space_type = 'CLIP_EDITOR' | |
2130 bl_region_type = 'UI' | |
2131 | |
2132 | |
2133 class CLIP_PT_mask_layers(MASK_PT_layers, Panel): | |
2134 bl_space_type = 'CLIP_EDITOR' | |
2135 bl_region_type = 'UI' | |
2136 | |
2137 | |
2138 class CLIP_PT_mask_display(MASK_PT_display, Panel): | |
2139 bl_space_type = 'CLIP_EDITOR' | |
2140 bl_region_type = 'UI' | |
2141 | |
2142 | |
2143 class CLIP_PT_active_mask_spline(MASK_PT_spline, Panel): | |
2144 bl_space_type = 'CLIP_EDITOR' | |
2145 bl_region_type = 'UI' | |
2146 | |
2147 | |
2148 class CLIP_PT_active_mask_point(MASK_PT_point, Panel): | |
2149 bl_space_type = 'CLIP_EDITOR' | |
2150 bl_region_type = 'UI' | |
2151 | |
2152 | |
2153 class CLIP_PT_tools_mask(MASK_PT_tools, Panel): | |
2154 bl_space_type = 'CLIP_EDITOR' | |
2155 bl_region_type = 'TOOLS' | |
2156 | |
2157 # --- end mask --- | |
2158 | |
2159 if __name__ == "__main__": # only for live edit. | |
2160 bpy.utils.register_module(__name__) | |
LEFT | RIGHT |