Run a script on frame change.

How can I set up a python script to execute on frame change. I’m writing a mesh deformer in python that I want to execute every frame change, infact the script uses context.scene.frame_change as a variable in the script. 2.49 had this functionality, 2.6 does not is there a work around, like using a driver, any help would be appreciated. Thanks!

answer:

example

import bpy

def translate(scenePassed): one variable is passed to your script by blender the scene so you must 2 >>>>>>>>>>>>>>>>>>have a variable to catch it.
>>>your code hear

bpy.app.handlers.frame_change_post.append(translate)

Now how do I get the handler script to execute when the program loads.
Time to search again.

I’m interested in the answer to this question. I’ve been working on a a realistic tank track rig, but it seems that I need a script to automatically have the treads change speeds while following a non-linear path.

Well I feel like an idiot, to get a script to load and exectute when you load a file all you have to do is check the register box on the script page. Dhaa!