Scriptjob to run during playback?

Scriptjob to run during playback?

Anonymous
Not applicable
1,292 Views
3 Replies
Message 1 of 4

Scriptjob to run during playback?

Anonymous
Not applicable
I need a script to run at every frame during playback. I tried making a scriptJob using the event "timeChanged", as well as the condition "playingBack" and the 'timeChange' attribute. The script only runs after the last frame of playback though, so I'm assuming Maya's event handler is "locked" during playback. Does anyone know of any solutions or workarounds to this? Do I need to start learning the Maya API? Thanks!

Windows 7
Maya 2011 x64
Python
0 Likes
1,293 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Hi, I've been looking into this thing as well, I wrote a script that would react to the playback being ON or OFF.

Everything worked fine till at one point I have restarted Maya , now it just reacts only after I stop scrubbing the timeline, can't figure out what changed!!!!????

It did work perfectly fine at first. Tried other events and conditions connected to the time line, getting the same result every time 😞
0 Likes
Message 3 of 4

Anonymous
Not applicable
here is another method,using a MEL call, add this to have the functions you have created execute at press or release, though this doesn't execute on simple playback, have to look into that as well, might be that the (playingBack) thing is buggy in python:


import maya.mel
playBackSlider = maya.mel.eval('$tmpVar=$gPlayBackSlider')
mc.timeControl( playBackSlider,edit=True,pressCommand='YourFunction1()',releaseCommand='YourFunction2()')
0 Likes
Message 4 of 4

Anonymous
Not applicable
Can you use an expression?
0 Likes