ZBrushCentral

Multiple loading script -- Why

Has anyone had the problem of a script loading more than once at startup or closing of menus. I hava a script that loads about 3-4 times on startup and then if I close (not hide ) any menu group in the left hand sliding menu, it runs again. It is a pretty complicated script so I will try to simplify it and see if I can reproduce the problem. If anyone has any advice on this, please let me know.

Chris To clarify:

it is a button script so I am assuming everything outside the button script should only be run once. This is not the case. It is calling one of my FileExecute functions multiple times. I will try to block it with a memory check if nothing else works. Thanks

Each time the size of the Tutorial Window is changed the current script is reloaded. I am guessing this was a quick way to update the formating of the current zscript.

So, opening/closing the left and right containers, unhiding the Tutorial Window, hiding/unhiding the float menu and manually resizing the tutorial window will all change the size and trigger a reload.

You will have to use a memoryblock to control the code outside of buttons, switches, and sliders.

Thanks,
good to know…

Chris Reid :smiley:

Another solution is to include the run-once code within an [if, statement:

example:

[VarDef, Once,1]
[If, (Once=1),
\ your only one STATEMENTS
[VarSet,Once,0]
]

ciao

cameyo