How to get user updates in Maya?

Hey,

I want write a python script in Maya that allows me to scrub through the time slider and misc functions are performed to a particular time frames. How do I constantly get updates on what the currentime is?

Thanks!

http://download.autodesk.com/us/maya/2010help/CommandsPython/scriptJob.html

see the -timeChange and -timeChanged arguments. Note, I don’t know whether you are using MEL or Python.

http://download.autodesk.com/us/maya/2010help/CommandsPython/scriptJob.html


import maya.cmds as cmds

def timelineChanged():
    currentTime = cmds.currentTime(q=1)
    if currentTime == 3:
        print 'I\'m doing something more here.'
    print 'Current time is: %s' %currentTime
    
timelineChangedScriptJob = cmds.scriptJob(event=('timeChanged', timelineChanged))

EDIT: Oh, btribble beat me to it =\

Thanks! scriptJob did the trick.