Tracking Long Animation Script

I wrote this script and it will track from one frame to the next. When I put it in a loop, it no longer works. I can hit the run key over and over again and it works perfect. How do I make this script run until final frame.

import bpy
import random

bpy.ops.object.select_all(action=‘DESELECT’)
ctx = bpy.context.copy()
for area in bpy.context.screen.areas:
   if area.type == ‘CLIP_EDITOR’:
      ctx[‘area’] = area
bpy.ops.clip.detect_features(ctx)
bpy.ops.clip.track_markers(ctx,backwards=False, sequence=False)
bpy.ops.object.select_all(action=‘DESELECT’)

Continuing the discussion from Tracking Long Animation Script:

I have also tried this and blender only goes forward one frame. I having trouble with changing which frame the script works on and deselecting features.

import bpy
import random
import math

det=0

bpy.ops.object.select_all(action=‘DESELECT’)
ctx = bpy.context.copy()

for numX in range (1, 10):
   bpy.context.scene.frame_set(numX)
   for area in bpy.context.screen.areas:
   if area.type == ‘CLIP_EDITOR’:
      ctx[‘area’] = area
   if det==0:
      bpy.ops.clip.detect_features(ctx)
      det=1

bpy.ops.clip.track_markers(ctx,backwards=False, sequence=False) bpy.ops.object.select_all(action=‘DESELECT’)

Check out my answer here :

Also try this add-on I just made specifically for long shots with a constantly evolving environment (read the Readme for instructions):

Hey! :slight_smile:
It’s looking nice, would you record a video for presentation of the addon? :smiley:
(It can be just workflow with it)
Have a nice day! :sun_with_face:

I intend to make a video tutorial but I first need to finish the TODO list of improvements so that my video tutorial doesn’t get outdated too quickly.
In the mean time don’t hesitate to ask me questions.

Gotcha! :grin:
When I’ll have little bit more free time I’ll experiment with that addon.
Keep it up! :smiley:

1 Like