0
$\begingroup$

I want to get the list of all tracking markers for the active clip in the clip editor and loop through each marker, so that I can do something with the markers, like get the (x,y) co-ordinate or delete it or change any other values like weight of the marker using python

$\endgroup$

1 Answer 1

1
$\begingroup$

This script

import bpy
D = bpy.data

for clip in D.movieclips:
    for track in clip.tracking.tracks:
        fn = 'data/tr_{0}_{1}.csv'.format(clip.name.split('.')[0], track.name)
        with open(fn, 'w') as f:
            frameno = 0
            while True:
                markerAtFrame = track.markers.find_frame(frameno)
                if not markerAtFrame:
                    break
                frameno += 1
                coords = markerAtFrame.co.xy
                f.write('{0} {1}n'.format(coords[0], coords[1]))

from Blender: exporting camera tracking markers to CSV contains code to do what you're looking for. You'll have to adapt it, of course.

$\endgroup$

You must log in to answer this question.

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