When does the ZScript execute.(one that loads at startup)
I can see it connect to all fileExecute dll's on load,
But it seems to not actualy run the rest of the script if there is a button in it. Except that my variable all get set correctly. I am most interested in global routine calls.
I am kind of confused.
I have made scripts that run everything when ZBrush loads, setting imageSize and buttons visible and whatnot.
So Is my script executing all global calls (anything not in a button) twice if there is a button there.
It appears it runs everything when I click the button again.
How would you make it not re-run the script (mainly global routine calls). I am probably missing something simple here. I will try to post an example of what I am talking about if no-one understands me.
<b>edited: added example file =======================================================>></b>
Place both the TXT and ZSC files in zbrushRoot.../ZStartup/ZPlugs/
If you don't have a ZPlugs Folder Create one. <u><b>WARNING: Any .ZSC file in this folder will load at startup.</b></u>
Once files are in the folder, <b>Restart ZBrush</b> and in the ZScript tab, you will find the button <b>[TestInitButtonFunc]
</b> Press it and you will see the NoteBar at the top of the ZBrush window.
Now, this was a global routine and called globally,so why is it called when I press the button?
[RoutineDef,MyFunc, //** Define Routine/Function
[VarSet,t1,"Only Should Be Called On Load"]
[NoteBar,t1,.5] //** Set Notebar on load
,input
]
[VarDef,v1,0]
[RoutineCall,MyFunc,v1] //** Call Routine/Function
[IButton, //** Just Clicking here will make the Notebar Show Up
"ZScript:TestInitButtonFunc",
"Test Global Commands",
//** I would think this shouldn't run global Routines/Funcs
[VarInc,v1]
[If,v1>1,[NoteBar,"",0]]//** clear notebar
]
Attached are the two files in the zip;
) that plugins load one after another on launch, then finally the defaultzscript loads. When one plugin (or zscript) loads it always replaces the previous one, so that variables are lost. So pressing a plugin button reloads it; it’s not constantly loaded.
ZScript 


One more question about plugins/scripts :
