View Single Post
# 2 14-01-2003 , 10:41 AM
mark_wilkins's Avatar
Registered User
Join Date: Jan 2003
Posts: 161
Nooooooo

you can't rely on expressions being executed in any particular order.

The way to do this is to make a script node with your initializations and set its execution attribute to run the script on scene open. Then, you're guaranteed that everything will end up initialized.

However, I'm curious -- why not use custom attributes instead of global variables? This would allow Maya to be more intelligent about recalculating your expressions -- in fact, I'm surprised you can get away with using global variables that way at all, because if the global variable changes value there's nothing (meaning no connection in the DG) to let Maya know that all the dependent expressions need to be recalculated, so it must just recalculate all of them every time...

-- Mark


Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com