Has anyone noticed a problem where a script node set to execute on open/close as a 'before' script actually evaluates AFTER expressions in the scene?
What I'm doing is declaring a global procedure in my script node. I then have an expression in my scene that calls that procedure. I've noticed that whenever I start a new instance of maya and load the scene an error is reported after the scene is read associated with the expression indicating that the procedure the expression is calling is not defined. However at this point, if the time slider is advanced, or if the procedure is called manually through the command line it works fine. In other words upon scene load it seems the script node that declares the procedure is getting executed AFTER the expression in the scene that needs to call the procedure.
Call me nuts, but I would expect the script node to evaluate before any expressions (script node is set to open/close as a 'before' script).
This ends up causing a real problem if the scene is saved with the time slider at a frame that you would later like to render through mayabatch. Because if you saved the scene with the time slider at frame 10, then when you go to render frame 10 the expressions fail to evaluate correctly affecting your render accordingly.
My current work-around is to save the scene with the time slider at a frame that's outside the range that will ever be rendered. This forces maya to actually step to a different frame when rendering assuring that the global procedure declared in the script node is available to subsequent calls via scene expressions.
Is this just a bug that sucks or is it intended to work this way?
thanks if you read this far,
greg