Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scriptjob to run during playback?

Message 1 of 4
1052 Views, 3 Replies

Scriptjob to run during playback?

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
Message 2 of 4
in reply to: Anonymous

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 😞
Message 3 of 4
in reply to: Anonymous

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()')
Message 4 of 4
in reply to: Anonymous

Can you use an expression?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators

Autodesk Design & Make Report