ZBrushCentral

Change alpha and then set it back to what it was before script?

Like the title says, I would like a script to remember what the currently active alpha map is, set a new map (that I will load, I have that part working). And then when the script is done, I want it to set the alpha back to the one that was on before starting (or turn it off if there wasn’t one). Any ideas? I have searched the forum and none of the techniques mentioned seem to be working for me. Thanks!

You can use the slider position at the top of the Alpha palette to store and reset the current alpha:

//store current alpha slider position
[VarSet, currentAlpha,[IGet,Alpha:Item Info]]
//do stuff
//reset alpha
[ISet,Alpha:Item Info,currentAlpha]

HTH,
Marcus

Yes! works great, thank you. There is one hiccup, however. It does work great if the current brush uses an alpha from the palette or one that I have explicitly loaded. however, if I use this with a brush that has it’s own alpha, then when I load a new alpha, the current brush’s alpha gets forgotten in the alpha palette so it doesn’t come back at the end of the script. Any thoughts on how to get around this?

You will need to make sure the current brush is selected at the end too. For that you can use the same method with [IGet,Brush:Item Info] for the slider at the top of the Brush palette.

If the alpha still won’t reset correctly then you could try:

[IPress, Brush:Reset Current Brush]

though note this will reset all the current brush settings to their defaults.