0
$\begingroup$

It seems that the motion tracking workspace is designed to be used to guide a 3D scene, but is it possible to export the position of one (or more) markers over time?

$\endgroup$
0

1 Answer 1

1
$\begingroup$

I just wanted to do the same thing: Export tracked marker locations in screen space for each frame. There is a Motion Tracking Export Plugin which seems to do that. Looking at its source code, the marker coordinates can be obtained in a few lines of Blender Python script:

import bpy

frameStart = bpy.context.scene.frame_start
frameEnd = bpy.context.scene.frame_end

clip = bpy.data.movieclips[0]
#videoWidth = clip.size[0]
#videoHeight = clip.size[1]
tracks = clip.tracking.tracks

for i in range(frameStart, frameEnd+1):
    firstTrack = tracks[0]
    #trackerName = firstTrack.name
    marker = firstTrack.markers.find_frame(i)
    x = marker.co.x # relative X coordinate between 0 and 1
    y = 1.0 - marker.co.y # flipped, relative Y coordinate between 0 and 1
$\endgroup$

Not the answer you're looking for? Browse other questions tagged .