Hello smart people! I know nothing about Python, but Blender needs a feature, and I don’t know where else to go.
When doing motion tracking, my goal is to use ‘detect features’ to auto-generate large amounts of track points inside an annotation to track deforming objects, such as shirts, skin, whatever. From there, I want to click both the ‘link empty to track’ and the ‘3d markers to mesh’ buttons (ideally, there would be a third button called ‘create hooked mesh’ or something that would do exactly what I’m about to explain). Now that we have animated empties as well as a “mesh” with free floating verts in the right spots, I’ll then go into edit mode on the mesh, use snapping to get the verts exactly on the nearest empties, then fill the whole thing with a face and triangulate it. At the moment, this is my starting point, but if we could also automate all that, that would be perfect.
From there, I’ve hacked together a janky script that I’ve actually succeeded in making add hooks to each vertex - EXCEPT the final one in the vertex index for some reason that I can’t figure out, or get around because of my lack of knowledge of Python. All the other vertices get hooked perfectly, but I can’t get it to make a hook for the last vertex no matter what I try.
Here’s my poor little script:
scene = context.scene
tri = scene.objects.get("Tracks")
if tri:
me = tri.data
for v in me.vertices:
name = f"Track.{v.index}"
mt = scene.objects.get(name)
hm = tri.modifiers.new(
name=name,
type='HOOK',
)
hm.object = mt
hm.vertex_indices_set([v.index])
Since I’ve got my generated Empties renamed, it manages to play nicely together and link up properly…except for the final vertex, of course.
Again, ideally, we could have an addon that adds a nice little button in the movie clip editor, in the Solve section, under the Geometry tab, that would automatically do every step of this process after tracking your makers. And frankly, I can’t understand why it hasn’t been done before now, because I can’t tell you how many times I’ve wanted to have that functionality.
I’m guessing it would be a simple enough process because of how far I’ve managed to get in just a few minutes without knowing a lick of Python, so here I am, begging for help. 
Thanks in advance!!!