ZBrushCentral

Cycling through palette items

It’s a fairly simple matter to build a zscript plugin that will cycle through palette items. The idea is to create two buttons that will select the next or previous item so that, with hotkeys assigned, quick selection is possible.

This example uses the Brush palette but the method would work just as well for alphas or textures. Each palette has an ‘Item Info’ slider and this can be set numerically, offering a simple way of selecting the item. Note that it’s important to loop the cycle when reaching the end of the sequence.

As Brushes are only available when sculpting the script also incorporates a check to see that there is a model in Edit mode.

The source code is in the text file. To install the plugin, unzip the zip file and move the ZSC to your ZStartup\ZPlugs folder. Restart ZBrush and there will be a ‘Brush Cycle’ submenu in the ZPlugin palette. Assign hotkeys to the buttons by Ctrl+clicking on them then choosing the hotkey.

fantastic… thanks

Looks great! TY

Works like a charm in the regular brush menu, however, I created a smaller brush palette as a user defined menu item with a smaller set of brushes. I was wondering if I could point the .txt at the the new menu item by replacing all instances of ‘brush:’ with ‘CycleBrush’ (the name of my UI menu.

This did not work, and I was wondering if you could enlighten me on how to achieve such a thing. Thanks a ton in advance!

pOiNtPuShEr,

You’ll need to take a slightly different approach in order to implement this for a custom menu. The different brushes can still be set through the slider in the Brush palette, but you’ll need to hard code in the values.

The attached script shows the method. This is set up for ten brushes - you’ll need to edit the script for the number you have in your custom arrangement. Then select each brush and note down the number from the slider at the top of the Brush palette. Enter these numbers into the list at the top of the script:

[VarSet,brushID(0),2]//this is number 2 in the slider
[VarSet,brushID(1),4]//this is number 4
[VarSet,brushID(2),6]//this is number 6

You must also edit the maxBrushes value at the top of the script to reflect your custom menu.

Let me know how you get on.

Hi all,

Scripting is not my world, I’m starting to learn it with Zbrush macro.

Is there a way to make a macro that cycle between 3 specific brush?
I want to have a macro that give me the possibility to toggle between three Zsphere2 brushes.:slight_smile:

Thanks,