|
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
- Howard Hsu http://www.linkedin.com/in/howardab234
Now using:
Windows XP 64 Pro v2003 SP2 (yes XP64 is still around)
Core 2 Quad CPU Q6600 @ 2.4GHz
2GB RAM
NVidia GeForce 8800 GTX
Max 2008 x64
Maya 2008 64
MotionBuilder 7.5
|
|
|
|
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 :(
|
|
|
|
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()')
|
|
|