diff --git a/Example/Tracking Test.blend b/Example/Tracking Test.blend index d6d221d..67aac86 100644 Binary files a/Example/Tracking Test.blend and b/Example/Tracking Test.blend differ diff --git a/README.md b/README.md index deace67..caf1d8e 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ The following is a recommended workflow for working with the addon: 11. Ensure the video footage from all cameras match up in real time. 12. In Blender, track the points of interest using the motion tracker, ensuring the camera settings such as focal length are set to the same as the real cameras, and that tracks for any given feature have the same name across all videos. 13. For each video, select all the tracks and use `Movie Clip Editor > Reconstruction > Link Empty to Track`, making sure they are associated with the correct Blender camera. -14. Select all the generated empties, and invoke `View3D > Object > Resolve Camera Tracks`. +14. Select all the generated empties, and invoke `Object > Resolve Camera Tracks`. 15. You should now have a set of Empty objects that track in 3D the locations of the real-world markers. These can now be used for animation; for example, as hooks for a rig. Usage ----- -The operator is accessible via `View3D > Object > Resolve Camera Tracks`, or `Search > Resolve Camera Tracks`. +The operator is accessible via `Object > Resolve Camera Tracks`, or `Search > Resolve Camera Tracks`. ### Before diff --git a/Resolve Camera Tracks.py b/Resolve Camera Tracks.py index b125905..fd7b84c 100644 --- a/Resolve Camera Tracks.py +++ b/Resolve Camera Tracks.py @@ -9,8 +9,8 @@ "author": "Anthony Zhang", "category": "Animation", "version": (1, 1), - "blender": (2, 75, 0), - "location": "View3D > Object > Resolve Camera Tracks or Search > Resolve Camera Tracks", + "blender": (2, 93, 0), + "location": "Object > Resolve Camera Tracks or Search > Resolve Camera Tracks", "description": "3D point reconstruction from multiple camera angles", } @@ -50,7 +50,7 @@ def execute(self, context): # select the resolved empties bpy.ops.object.select_all(action="DESELECT") - for empty in resolved_empties: empty.select = True + for empty in resolved_empties: empty.select_set(True) return {"FINISHED"} @@ -180,8 +180,8 @@ def add_resolved_empty(self, targets): # make the resolved track object more identifiable track, _ = self.get_target_track(targets[0]) resolved.name = "{}_tracked".format(track.name) - resolved.empty_draw_type = "SPHERE" - resolved.empty_draw_size = 0.1 + resolved.empty_display_type = "SPHERE" + resolved.empty_display_size = 0.1 self.report({"INFO"}, "{}: min error {} (frame {}), max error {} (frame {})".format(resolved.name, min_distance / 2, min_distance_frame, max_distance / 2, max_distance_frame)) return resolved @@ -197,11 +197,11 @@ def closest_point(cam1, cam2, point1, point2): dir1 = point1 - cam1 dir2 = point2 - cam2 dir3 = cam2 - cam1 - a = dir1 * dir1 - b = -dir1 * dir2 - c = dir2 * dir2 - d = dir3 * dir1 - e = -dir3 * dir2 + a = dir1.dot(dir1) + b = -dir1.dot(dir2) + c = dir2.dot(dir2) + d = dir3.dot(dir1) + e = -dir3.dot(dir2) if abs((c * a) - (b ** 2)) < 0.0001: # lines are nearly parallel raise Exception("Lines are too close to parallel") extent1 = ((d * c) - (e * b)) / ((c * a) - (b ** 2)) diff --git a/Screenshot.png b/Screenshot.png index 9369941..05104fa 100644 Binary files a/Screenshot.png and b/Screenshot.png differ