Notifications
Clear all

[Closed] Script needs to be evaluated twice for it to work

I have created a script together with a programmer to convert materials between standard Max materials and our custom shader we use for real time graphics. It work perfectly except that every time you start Max you have to Evaluate the script twice for it to run properly.

Is this a know issue and is there a workaround for it?

3 Replies

Hi James,
does the script throw any error after first evaluation?
Without any evidence, here is my very very long shot. There could be variables/structures/any other kind of data, the script needs to be already loaded in memory. First evaluation stores those values, but doesn’t work because they’re not initialized when actually needed, while second evaluation works because stored values are already there, like global values. I hope this helps.

  • Enrico

it sounds like a local, global issue. check your variables, functions and so on.

Thanks for your help. Our programmer managed to solve it by breaking out the functions that were in the script and putting them in a extra script in the scripts/startup folder so they would initialize when max starts. So when we call upon them from other scripts Max knew what to do…

I learn a little more for every day…