ZBrushCentral

Cycle Brushes

Hi, im trying to make a button that cycles between two brushes. This should be pretty simple but im stuck right now. Here is the code im working with.

 
//ZBRUSH MACRO - Recorded in ZBrush version 3.5
[IButton,???,"Cycles between ClayTubes and Move brushes",
[IShowActions,0]
[IConfig,3.5]
[If,[IgetTitle, Brush:Current Brush] = ClayTubes,
[IPress,Brush: Move]
,
[IPress,Brush: Claytubes]
]
, , .25, , "Brush.bmp", .25]

Can you see anything I need to add to get this to work?

You can’t test for equality between strings like that. You need to use [StrFind, which will give the starting index of the string if it is found or -1 if it is not. To make sure that we have the string we want it’s also useful to check the string length, in case there’s also a brush called ‘ClayTubes2’ for example.

Also using the [IGetTitle command in its default state for brushes will return the path where the file is stored, so set the arg to 1 so you can be sure of the right string length. You also need to set a variable to the [IGetTitle string as coding something like ([StrFind,“ClayTubes”,[IGetTitle,Brush:Current Brush,1]]>-1) will not work.

//ZBRUSH MACRO - Recorded in ZBrush version 3.5
[IButton,???,"Cycles between ClayTubes and Move brushes",
[IShowActions,0]
[IConfig,3.5]
[VarSet,len,[StrLength,"Brush:ClayTubes"]]
[VarSet,str,[IGetTitle,Brush:Current Brush,1]]
[If,(([StrLength,str] == len)&&([StrFind,"ClayTubes",str]>-1)),
[IPress,Brush: Move]
,
[IPress,Brush: Claytubes]
]
, , .25, , "Brush.bmp", .25]

HTH,

Ok, I’m squirming in my chair at the thought of being able to toggle multiple brushes. I’ve been wanting this for… freaking… ever. A keyboard binding would be amazing, but I’ll take what I can get.

If you ever get this working, please post it for the community.

I really wish every brush had a “Duo-Brush” option, where you could pair up 2 brushes of your choosing to toggle between, and save the Duo-Brush as a custom brush when Zbrush starts up.

Hi,

I came across this thread while looking for a certain feature in ZBrush that may/may not exist. A google search and a quick canvas of the forums yielded no specific results so I thought I would piggy-back on the original post since it is a similar topic.

I was hoping to setup a hotkey to toggle between the current and last used brush. Is there a script that can accomplish this or is this already a feature and I just don’t know about it? Thanks in advance.

-NBreslow

You can’t do it quite as you want in that a macro or plugin can’t ‘listen’ to which brushes you are selecting but see here for a similar solution:

http://www.zbrushcentral.com/showpost.php?p=871353&postcount=52

This will definitely be useful. As always, your quick responses and hands on help is appreciated! Thanks Marcus,

-NB

I am using this toggle and its working great thank you.