ZBrushCentral

Question: Update slider limits after loading variables?

maxSdivP is used as a value of a max slider value but it only updates when I reload the script I would like it to update after hitting Save Peferences (i know typo) Is this possible?

[VarLoad, maxSdivP, PreferencesQuickTools]
[IButton, “Save Peferences”, “Saves the current preferences”,

[VarSet, maxSdivP, ZScript:maxSDiv]

[VarSave, maxSdivP, PreferencesQuickTools]

[VarLoad, maxSdivP, PreferencesQuickTools]

]

also what does the Val and ,n] do?

[SubToolSelect,[Val,n]]

I also saw that there was ,n] after a loop to end it?

I don’t think there’s a way to do it without reloading the script, and even that probably wouldn’t work for a plugin. Probably the best way of getting a limit to work is by incorporating some code like this:

[If,[IGet,0] > sMax, [ISet,0,sMax]]

where sMax a variable with value of the slider maximum. The [IGet,0] and [ISet,0 is shorthand for IGet/ISet,“this item path”.

If you have a loop:

[Loop,[SubToolGetCount],

[SubToolSelect,[Val,n]]

,n]

Then the ‘n’ at the bottom is the loop counter variable, so will hold the loop iteration, starting at 0 for the first iteration.

[SubToolSelect,[Val,n]] selects the subtool which has the value of the loop counter variable, so will start at the top and move down one subtool each time the loop iterates.

HTH,

Thanks man helps a lot! I assume ZBrush reloads the script if you put it in your zplug folder as szc everytime you restart ZBrush?

Yes, that’s right. It would be possible to have a different slider max on ZBrush startup. Your plugin would need to load the preferences file before the plugin interface was created.

Thanks for the help as always!