From f4745763514a51bf841fc2c344d62242bdc297da Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 14 Nov 2011 06:41:42 +0000 Subject: Camera tracking: interface cleanup and small buttons renaming - Move tracking-related constraints to own section in list Currently there are only two constraints, so can look a bit odd, but it'll be other constraints like "Object Solver" and so. - Move motion-tracking parameters from 3D viewport Display panel to it's own panel. - Get rid of "Bundle" in 3d viewport. It's quite obvious that it's a 3D representation of tracks is used in 3D viewport and it shouldn't be so confusing for artists now. - Also get rid of "Bundle" in Follow Track constraint. Old files can change a bit because of changes in DNA. - Also get rid of "Bundles" in operator which creates vertices cloud from 3D position of tracks. - Rename "Principal Point" to "Optical Center" in the interface. --- release/scripts/startup/bl_operators/clip.py | 16 ++++----- .../startup/bl_ui/properties_object_constraint.py | 5 +-- release/scripts/startup/bl_ui/space_clip.py | 7 ++-- release/scripts/startup/bl_ui/space_view3d.py | 41 ++++++++++++++++------ 4 files changed, 45 insertions(+), 24 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index 55592621112..203a1673c0b 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -63,16 +63,16 @@ class CLIP_OT_track_to_empty(Operator): constraint.clip = sc.clip constraint.track = track.name - constraint.reference = 'TRACK' + constraint.use_3d_position = False return {'FINISHED'} -class CLIP_OT_bundles_to_mesh(Operator): - """Create vertex cloud using coordinates of bundles""" +class CLIP_OT_tracks_to_mesh(Operator): + """Create vertex cloud using coordinates of tracks""" - bl_idname = "clip.bundles_to_mesh" - bl_label = "Bundles to Mesh" + bl_idname = "clip.tracks_to_mesh" + bl_label = "Tracks to Mesh" bl_options = {'UNDO', 'REGISTER'} @classmethod @@ -91,7 +91,7 @@ class CLIP_OT_bundles_to_mesh(Operator): new_verts = [] - mesh = bpy.data.meshes.new(name="Bundles") + mesh = bpy.data.meshes.new(name="Tracks") for track in clip.tracking.tracks: if track.has_bundle: new_verts.append(track.bundle) @@ -100,7 +100,7 @@ class CLIP_OT_bundles_to_mesh(Operator): mesh.vertices.add(len(new_verts)) mesh.vertices.foreach_set("co", unpack_list(new_verts)) - ob = bpy.data.objects.new(name="Bundles", object_data=mesh) + ob = bpy.data.objects.new(name="Tracks", object_data=mesh) bpy.context.scene.objects.link(ob) @@ -252,7 +252,7 @@ class CLIP_OT_constraint_to_fcurve(Operator): if not con: return - if con.type == 'FOLLOW_TRACK' and con.reference == 'BUNDLE': + if con.type == 'FOLLOW_TRACK' and con.use_3d_position: mat = ob.matrix_world.copy() ob.constraints.remove(con) ob.matrix_world = mat diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index 508818b62dc..8cdb07461bb 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -754,14 +754,15 @@ class ConstraintButtonsPanel(): col.prop(con, "rotation_range", text="Pivot When") def FOLLOW_TRACK(self, context, layout, con): - layout.prop(con, "use_active_clip") + row = layout.row() + row.prop(con, "use_active_clip") + row.prop(con, "use_3d_position") if not con.use_active_clip: layout.prop(con, "clip") layout.prop(con, "track") - layout.row().prop(con, "reference", expand=True) layout.operator("clip.constraint_to_fcurve") diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index d14d3450942..968c583f1fe 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -205,7 +205,7 @@ class CLIP_PT_tools_geometry(Panel): def draw(self, context): layout = self.layout - layout.operator("clip.bundles_to_mesh") + layout.operator("clip.tracks_to_mesh") layout.operator("clip.track_to_empty") @@ -227,7 +227,6 @@ class CLIP_PT_tools_orientation(Panel): settings = sc.clip.tracking.settings col = layout.column(align=True) - col.label(text="Scene Orientation:") col.operator("clip.set_floor") col.operator("clip.set_origin") @@ -371,7 +370,7 @@ class CLIP_PT_tracking_camera(Panel): col.prop(clip.tracking.camera, "pixel_aspect") col = layout.column() - col.label(text="Principal Point") + col.label(text="Optical Center:") row = col.row() row.prop(clip.tracking.camera, "principal", text="") col.operator("clip.set_center_principal", text="Center") @@ -769,7 +768,7 @@ class CLIP_MT_reconstruction(Menu): layout.separator() layout.operator("clip.track_to_empty") - layout.operator("clip.bundles_to_mesh") + layout.operator("clip.tracks_to_mesh") class CLIP_MT_track_visibility(Menu): diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 32ac4284267..97e40bfff30 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2165,16 +2165,6 @@ class VIEW3D_PT_view3d_display(Panel): layout.separator() - layout.prop(view, "show_reconstruction") - if view.show_reconstruction: - layout.label(text="Bundle type:") - layout.prop(view, "bundle_draw_type", text="") - layout.prop(view, "bundle_draw_size") - layout.prop(view, "show_bundle_name") - layout.prop(view, "show_camera_path") - - layout.separator() - region = view.region_quadview layout.operator("screen.region_quadview", text="Toggle Quad View") @@ -2190,6 +2180,37 @@ class VIEW3D_PT_view3d_display(Panel): row.prop(region, "use_box_clip") +class VIEW3D_PT_view3d_motion_tracking(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'UI' + bl_label = "Motion Tracking" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + view = context.space_data + return (view) + + def draw_header(self, context): + layout = self.layout + view = context.space_data + + layout.prop(view, "show_reconstruction", text="") + + def draw(self, context): + layout = self.layout + + view = context.space_data + + col = layout.column() + col.active = view.show_reconstruction + col.prop(view, "show_tracks_name", text="Show Names") + col.prop(view, "show_camera_path") + col.label(text="Tracks:") + col.prop(view, "tracks_draw_type", text="") + col.prop(view, "tracks_draw_size", text="Size") + + class VIEW3D_PT_view3d_meshdisplay(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' -- cgit v1.2.3