How to add an animated time controlled text effect to the VSE I'm trying to edit videos for my dance group. What I'd like to be able to do is have an overlay that I can set the B.P.M (beats per minute) and I can display a simple metronome + counter over the video.

I notice that there is a text effect in the VSE



Is there any way to hook a callback based on the frame count that can change the text as the video progresses? This might be able to get me what I need.

Progress

I've discovered that I can do

import bpy

def my_handler(scene):
    print("Frame Change", scene.frame_current)

bpy.app.handlers.frame_change_pre.append(my_handler)


and the current frame count is output to the console. Now I would need to calculate and inject some text into the VSE

First real attempt

import bpy

def my_handler(scene):
    print("Frame Change", scene.frame_current)
    ob = bpy.data.objects['TimeCode']
    ob['Text']=scene.frame_current


bpy.app.handlers.frame_change_pre.append(my_handler)


where I have a text effect added to the VSE and defined as



but I get console errors as


  File "C:\Users\bradp\OneDrive\Video\NewStyle
  C\choreo1.blend\Counter", line 7, in my_handler KeyError:
  'bpy_prop_collection[key]: key "TimeCode" not found'
You can use Animation Nodes to do this very easily:



You can do all sort of editing like:



The Frame Rate input is hidden by default, show it like this: