Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Python / scriptJob to NOT run at playback?
  RSS 2.0 ATOM  

scriptJob to NOT run at playback?
Rate this thread
 
58821
 
Permlink of this thread  
avatar
  • Total Posts: 2
  • Joined: 26 May 2010 07:22 PM

Hey,

I need a scriptjob to run whenever an enum attribute changes on a specified node. The problem I’m having is that it also runs the job whenever I change the frame in the timeline or during playback.

leftHandJob scriptJob(ac=[u'leftHandIkFkSwitch.IkFkSwitcher',u'leftHandSwitcher()']kws=True)

This is the faulty job.

I tried to fix it by adding in timechanged=u’pass’, but to no avail. It only lets you do one condition.

leftHandJob scriptJob(ac=[u'leftHandIkFkSwitch.IkFkSwitcher',u'leftHandSwitcher()']kws=Truetc=u'pass')
# Error: RuntimeError: You must specify exactly one of the following flags: -ct -cf -cc -e -ie -ac -con -tc -uid -lc -le -j -k -ka -ex #

I didn’t realize this before because there were no markers on my screen, but since I added in a keyframe element to the function, it shows up on every single frame when I scrub through the timeline.

Is there a way to get this function to run when and only when the named attribute changes?
Any help or suggestions would be greatly appreciated, Thanks!

~Sean



Replies: 0
avatar

Well… I fixed the immediate problem by using the undoInfo(q=True, un=True) command and an if statement. However, it’s probably a good idea if Autodesk takes a look at this scriptJob bug.



Replies: 0
avatar
  • ldunham1
  • Posted: 16 September 2011 11:41 PM

try using an expression.

what are you trying to do in the function the scriptjob is calling?



Lee Dunham | Character TD
ldunham.blogspot.com

Replies: 0