View Full Version : Execute Script during playback
02-18-2008, 09:59 PM
I have defined a script job that exectues a script everytime a value is changed.
When animating this Attribute and play the animation by hitting the play button it seems
that the script is not beeing executet during playback.
Is there a flag I have to set or something different which allows the script to execute also during (animation) playback?
02-19-2008, 12:24 AM
Have you tried expressions?
02-19-2008, 01:56 AM
like michael said, you can have an expression to produce the desired effect ..
from the help : "Script jobs are tied to the event loop in the interactive application. They are run during idle events. This means that script jobs do not exist in the batch application. The scriptJob command does nothing in batch mode. This triggering happens very frequently so for speed considerations no events are forwarded during playback. This means that you cannot use scriptJob -tc tcCallback; to alter animation behaviour. Use an expression instead"
maybe if you tell what u r trying to achieve, we can tailor the expression ?
02-19-2008, 11:59 AM
I'm using a value which - when it is changed - it generets n amounts of objects. Before these objects are createte the script deletes the old ones thus only n amount of objects are present at any time.
I tried to drive the script via an expression but got every time the script was executed a fatal error, I don't know why. I'm using Maya 2008 but I'll try it again until I figure it out.
Also I had the problem that this expression was executed every frame making it impossible for me to preview my animation in a reasonable speed. The "on demand" option didn't seem to work ether although the attribute that effects the expression was indeed changed.
Hope you can help me!
Edit: I narrowed it down to this problem:
After my first expression sources and executes a script, a second script is executed which
creates pointOnSurfaceNodes onto a surface, here the error:
// Error: file: E:/Production/Files/maya/scripts/makedynamic.mel line 25: Connection not made: 'revolvedSurfaceShape2.worldSpace' -> 'pointOnSurfaceInfo323.inputSurface'. Connections cannot be modified during evaluation. /
02-19-2008, 11:59 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.