Looks like that thread is adding new markers… is that what you really wanted?
I’m just getting into some serious python so I treated this as a learning experience and spent a couple hours trying figure out how to move a selected marker at the current frame… (yeah, it took me that long… no worries, I picked up alot of useful info along the way :yes:)
anyway, just in case, here’s what I came up with:
import bpy
curframe = bpy.context.scene.frame_current
###################################################
# if you are making addon for the clip editor, #
# you can use top and comment out bottom #
###################################################
#clip = bpy.context.space_data.clip # will not work in text editor
clip = bpy.data.movieclips['P1010123.MP4'] # use your clip name here
###################################################
size = clip.size
marker =clip.tracking.tracks.active.markers
for m in marker:
if (m.frame == curframe):
break
print ("frame %d selected marker location x: %6.3f (pixel %6.3f)" % (curframe, m.co[0], m.co[0] * size[0]))
print ("frame %d selected marker location y: %6.3f (pixel %6.3f)" % (curframe, m.co[1], m.co[1] * size[1]))
moveto_x = 1050 # new x location in pixels
moveto_y = 700 # new y location in pixels
m.co.__setitem__(0, moveto_x / size[0])
m.co.__setitem__(1, moveto_y / size[1])
print ("frame %d selected marker new location x: %6.3f (pixel %6.3f)" % (curframe, m.co[0], m.co[0] * size[0]))
print ("frame %d selected marker new location y: %6.3f (pixel %6.3f)" % (curframe, m.co[1], m.co[1] * size[1]))