Auto-answer to my own message : I got time to look arround myself and got some success.
Execute the following Maya script : testVar=5 cmds.scriptNode( n='test script node R', bs='print "current time is %f" %maya.cmds.currentTime(q=1); print "value of testVar : %i" %testVar;', st=7, stp='python' ) Note that the "st" flag is 7 => "Execute on time changed" (see http://download.autodesk.com/global/docs/maya2014/en_us/CommandsPython/scriptNode.html#flagbeforeScript for the documentation of the script Node Command) Then play the animation. It outputs : current time is 1.000000 value of testVar : 5 current time is 2.000000 value of testVar : 5 ... and so forth. Rational : 1/ python script node has access to the interpreter's global variables 2/ when set as "Execute on time changed", a script node is not auto-deleted once executed. just the behaviour we were looking for. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/22e6da1a-a439-4b80-9d11-85b37fafb5e5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
