[Closed] Slow starting script if executed from button in toolbar
Hi all!
I have a script with a strange behaviour. It’s assigned to a button in a toolbar. When I push the button I have to wait some seconds before the script window appears. This delay is because all the lines of the script are showed in the listener window, from start to finish.
But if I evaluate the script from maxscript editor, this is not happening, so the scripts starts faster.
What can I do to avoid this?
thanks!
Hmm, if the script is on a button on a toolbar, it MUST be inside a
MacroScript Somename category:“SomeCategory” (
)
body, which should prevent the script from outputting anything to the Listener unless some form of PRINT or FORMAT is being used in the code.
As mentioned already, without seeing at least a small portion of what the script looks like, it is difficult to find the problem…
Is it dynamically generating a UI? Looks like it’s pushing everything in a string and evaluates it and maybe something goes wrong with some variable scope issue. Do you have to run it twice on a fresh max start? That’s mostly a sign somethings not quite right…
Without seeing any code, I cannot say anything more useful then this,
-Johan
Hmm, if the script is on a button on a toolbar, it MUST be inside a
MacroScript Somename category:"SomeCategory" (
)
That’s it!! Thanks, Bobo!
Thanks, JHN, for your quick answer too!