Execute Script per Frame Event

The following script shows setting a Driver to execute a Python script for every frame of an animation:


Is there:

  • A tutorial that shows how to set up such an environment?
  • Another way that does not involve an armature hack?

I am trying to change the text of a font object to be the distance between the camera and another object. So every time the camera moves, the distance should recalculate.

Eventually I’d like to create an add-on that calculates the distance between any two objects for every frame of an animation.

Any help would be greatly appreciated.

Blender 2.57b (or better).