From 3d724d8df55d56731e49e73c4fead32deef661e3 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 15 Nov 2011 12:20:58 +0000 Subject: Camera tracking: made some options more easy to understand - Changed some names so now people who aren't really familiar with motion tracking can understand what they exactly means - Also cleaned up and rephraded some descriptions - Changed behavior of operator which creates empty for 2d tracks: now it operates on all selected tracks rather than active track only - Added checkbox to enable/disable rotation stabilization --- release/scripts/presets/camera/Sony_A55.py | 5 +++ .../scripts/presets/tracking_camera/Sony_A55.py | 11 +++++++ release/scripts/startup/bl_operators/clip.py | 38 +++++++++++++--------- release/scripts/startup/bl_ui/space_clip.py | 36 +++++++++++--------- release/scripts/startup/bl_ui/space_view3d.py | 2 +- 5 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 release/scripts/presets/camera/Sony_A55.py create mode 100644 release/scripts/presets/tracking_camera/Sony_A55.py (limited to 'release') diff --git a/release/scripts/presets/camera/Sony_A55.py b/release/scripts/presets/camera/Sony_A55.py new file mode 100644 index 00000000000..0de8198972a --- /dev/null +++ b/release/scripts/presets/camera/Sony_A55.py @@ -0,0 +1,5 @@ +import bpy +bpy.context.object.data.sensor_width = 23.4 +bpy.context.object.data.sensor_height = 15.6 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' + diff --git a/release/scripts/presets/tracking_camera/Sony_A55.py b/release/scripts/presets/tracking_camera/Sony_A55.py new file mode 100644 index 00000000000..f3095c6ec28 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Sony_A55.py @@ -0,0 +1,11 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.4 +camera.sensor_height = 15.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index 203a1673c0b..091e3defbf8 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -24,27 +24,27 @@ from bpy.types import Operator from bpy_extras.io_utils import unpack_list +def CLIP_track_view_selected(sc, track): + if track.select_anchor: + return True + + if sc.show_marker_pattern and track.select_pattern: + return True + + if sc.show_marker_search and track.select_search: + return True + + return False + class CLIP_OT_track_to_empty(Operator): """Create an Empty object which will be copying movement of active track""" bl_idname = "clip.track_to_empty" - bl_label = "2D Track to Empty" + bl_label = "Link Empty to Track" bl_options = {'UNDO', 'REGISTER'} - @classmethod - def poll(cls, context): - if context.space_data.type != 'CLIP_EDITOR': - return False - + def _link_track(self, context, track): sc = context.space_data - clip = sc.clip - - return clip and clip.tracking.tracks.active - - def execute(self, context): - sc = context.space_data - clip = sc.clip - track = clip.tracking.tracks.active constraint = None ob = None @@ -65,6 +65,14 @@ class CLIP_OT_track_to_empty(Operator): constraint.track = track.name constraint.use_3d_position = False + def execute(self, context): + sc = context.space_data + clip = sc.clip + + for track in clip.tracking.tracks: + if CLIP_track_view_selected(sc, track): + self._link_track(context, track) + return {'FINISHED'} @@ -179,7 +187,7 @@ class CLIP_OT_delete_proxy(Operator): class CLIP_OT_set_viewport_background(Operator): - """Set current movie clip as a camera background in 3D viewport""" + """Set current movie clip as a camera background in 3D viewport (works only when a 3D viewport is visible)""" bl_idname = "clip.set_viewport_background" bl_label = "Set as Background" diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 968c583f1fe..c6af6bab1d1 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -55,7 +55,11 @@ class CLIP_HT_header(Header): if sc.show_filters: row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_DOWN', text="Filters") - row.prop(sc, "show_graph_frames", icon='SEQUENCE', text="") + + sub = row.column() + sub.active = clip.tracking.reconstruction.is_valid + sub.prop(sc, "show_graph_frames", icon='SEQUENCE', text="") + row.prop(sc, "show_graph_tracks", icon='ANIM', text="") else: row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_RIGHT', text="Filters") @@ -130,16 +134,16 @@ class CLIP_PT_tools_tracking(Panel): props = col.operator("clip.clear_track_path", text="Clear Before") props.action = 'UPTO' - props = col.operator("clip.clear_track_path", text="Clear Track Path") + props = col.operator("clip.clear_track_path", text="Clear") props.action = 'ALL' - layout.operator("clip.join_tracks") + layout.operator("clip.join_tracks", text="Join") -class CLIP_PT_tools_solving(Panel): +class CLIP_PT_tools_solve(Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' - bl_label = "Solving" + bl_label = "Solve" @classmethod def poll(cls, context): @@ -154,7 +158,7 @@ class CLIP_PT_tools_solving(Panel): settings = clip.tracking.settings col = layout.column(align=True) - col.operator("clip.solve_camera") + col.operator("clip.solve_camera", text="Camera Motion") col.operator("clip.clear_solution") col = layout.column(align=True) @@ -405,8 +409,8 @@ class CLIP_PT_display(Panel): col.prop(sc, "show_disabled", "Disabled Tracks") col.prop(sc, "show_bundles", text="Bundles") - col.prop(sc, "show_names", text="Track Names") - col.prop(sc, "show_tiny_markers", text="Tiny Markers") + col.prop(sc, "show_names", text="Track Names and Status") + col.prop(sc, "show_tiny_markers", text="Compact Markers") col.prop(sc, "show_grease_pencil", text="Grease Pencil") col.prop(sc, "use_mute_footage", text="Mute") @@ -421,7 +425,7 @@ class CLIP_PT_display(Panel): clip = sc.clip if clip: - col.label(text="Display Aspect:") + col.label(text="Display Aspect Ratio:") col.prop(clip, "display_aspect", text="") @@ -496,23 +500,21 @@ class CLIP_PT_stabilization(Panel): layout.prop(stab, "influence_location") - layout.separator() - layout.prop(stab, "use_autoscale") col = layout.column() col.active = stab.use_autoscale col.prop(stab, "scale_max") col.prop(stab, "influence_scale") - layout.separator() - - layout.label(text="Rotation:") + layout.prop(stab, "use_stabilize_rotation") + col = layout.column() + col.active = stab.use_stabilize_rotation - row = layout.row(align=True) + row = col.row(align=True) row.prop_search(stab, "rotation_track", tracking, "tracks", text="") row.operator("clip.stabilize_2d_set_rotation", text="", icon='ZOOMIN') - row = layout.row() + row = col.row() row.active = stab.rotation_track is not None row.prop(stab, "influence_rotation") @@ -854,6 +856,7 @@ class CLIP_MT_tracking_specials(Menu): class CLIP_MT_camera_presets(Menu): + """Predefined tracking camera intrinsics""" bl_label = "Camera Presets" preset_subdir = "tracking_camera" preset_operator = "script.execute_preset" @@ -861,6 +864,7 @@ class CLIP_MT_camera_presets(Menu): class CLIP_MT_track_color_presets(Menu): + """Predefined track color""" bl_label = "Color Presets" preset_subdir = "tracking_track_color" preset_operator = "script.execute_preset" diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 97e40bfff30..2bfbd15cf55 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2204,7 +2204,7 @@ class VIEW3D_PT_view3d_motion_tracking(Panel): col = layout.column() col.active = view.show_reconstruction - col.prop(view, "show_tracks_name", text="Show Names") + col.prop(view, "show_tracks_name") col.prop(view, "show_camera_path") col.label(text="Tracks:") col.prop(view, "tracks_draw_type", text="") -- cgit v1.2.3