Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_operators/clip.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py
index 5bce5645e42..72a26fd36e2 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -189,6 +189,15 @@ class CLIP_OT_bundles_to_mesh(Operator):
new_verts = []
+ scene = context.scene
+ camera = scene.camera
+ matrix = Matrix.Identity(4)
+ if camera:
+ reconstruction = tracking_object.reconstruction
+ framenr = scene.frame_current - clip.frame_start + 1
+ reconstructed_matrix = reconstruction.cameras.matrix_for_frame(framenr)
+ matrix = camera.matrix_world * reconstructed_matrix.inverted()
+
mesh = bpy.data.meshes.new(name="Tracks")
for track in tracking_object.tracks:
if track.has_bundle:
@@ -200,6 +209,8 @@ class CLIP_OT_bundles_to_mesh(Operator):
ob = bpy.data.objects.new(name="Tracks", object_data=mesh)
+ ob.matrix_world = matrix
+
context.scene.objects.link(ob)
return {'FINISHED'}