Hey all,
I'm finding myself using Zbrush more and more for the creation of tiling textures. I've yet to find a quick way to set wrap mode for all brushes at once, and have to do it for each brush individually. Anyone know a way to set a global value for this?
Replies
So after bumping into this thread I thought would be cool to have a toggle switch button, so I modified cryrid script with a little to use the ISwitch command.
I created a simple script that add the Brush WrapMode subpallet in the Zplugin menu that contain a switch button named WrapMode: when enabled sets the WrapMode of the selected brush to 1, when disabled reset the WrapMode of the selected brush to 0.
That's the code:
At the moment unfortunately the button switch doesn't work as I would like.
The button status (ON/OFF) doesn't update when I change brush.
Lets say that I am using the Standard brush and I enable the WrapMode using my script (the button turns ON), then I change brush, but the button remains ON (instead should turn OFF because that other brush has WrapMode set to = at the moment).
The problem is that I cannot figure out a way to update the button switch status according to each brush I select.
It should be matter, each time I select a new brush, to read the WrapMode value of each brush and then update the WrapMode status button accordingly.
After checking the Pixologic documentation about the ISwitch command I tried many different scripts but I cannot figure out a solution that solves the bug described above.
Anybody can help me please? :poly122:
I asked on the Zscript Pixologic Forum and I have been told that this is one of the limit of the current Zscripting.
So the only doable solution is to make a simple button and place it in the interface near the WrapMode slider to be able to tell if is set to 0 or 1.
That's the code to create the Brush WrapMode subpallet in the Zplugin menu that contain a switch button named WrapMode: the button toggle the WrapMode of the selected brush between 0 and 1.
You can also directly download the plugin (that works on bot 32 & 64 bit) from here: https://www.dropbox.com/s/bj6pwr1i9ssir0o/Wrap_Mode_Toggle.zsc?dl=0
I hope this helps.
So you had to activate the script and go through all the brushes you intended to use (the wrapmode gets saved with the brush, but only for the current instance of ZBrush) and then go on your merry way. Until you managed to pull up another brush
I'm guessing you might be able to write a script to go through all the brushes and set wrap mode?
Hey Farfarer many thanks for the tip.
Your solution sounds really interesting and possibly the most efficient one because removes the silly task to set the wrap mode for each brush one by one.
However it sound dangerous as well (if it can interfere with the selection method of certain brushes). What is not clear to me is: once activated your script will be always on until you close ZBrush? Or is more like a toggle, like you turn the script on (that sets all the brush you select to WrapMode 1) and then you turn it off (meaning it stops affecting the mouse and the selection as well).
I am not thatacknowledged about Zscripting yet and I have never messed up with the mouse functions so far (so I am not sure how it works). I will look into it asap to see what I can do.
In effect this was my initial idea, then I though would be better to control the WrapMode for each brush instead of setting it globally, even because I still don't know how to affect all the brushes at once, I would need to do some research about it (I will have a look to the Pixologic documentation). :poly121:
That's the code, that can be customized according to your needs.
The code beow creates the Brush WrapMode subpallet in the Zplugin menu that contain a button named WrapMode Main Brushes: the button toggle the WrapMode of the brushes listed below between 0 and 1. Obviously these are the brushes that I want to affect. you can add or remove the brushes and fix the brushCount number at the beginning of the script.
with some help from the ZBrushCentral community (in particular Mark "TVeyes" that helped me with the most difficult code parts) I managed to perfect the code.
In the previous version the WrapMode was not changed for the hardcoded Smooth and Masking brushes: in with this new version the Smooth and Masking brushes WrapMode is finally affected by the script as the regular sculpting brushes.
The code below creates the Brush WrapMode subpallet in the Zplugin menu that contain a button named WrapMode Main Brushes: the button toggle the WrapMode of the brushes listed below between 0 and 1.
Obviously the brushes hardcoded in the scipt below are the brushes that I want to affect: you can customize the script adding or removing the brushes you need.
When adding or removing brushed remember to fix the brushCount number at the beginning of the script ( this number is meant to be the totale number of brushes +1, because you start counting from the brush 0).
Also bear in mind that the brushType(#), # variable defines the type of brush that you are hard coding, as explained below:
- brushType(#), 0: Modeling brush.
Example below:
[VarSet, brushes(1), "Brush:Standard"] [VarSet, brushType(1), 0]
- brushType(#), 1: Smooth brush.
Example below:
[VarSet, brushes(29), "Brush:Smooth"] [VarSet, brushType(29), 1]
- brushType(#), 2: Masking brush.
Example below:
[VarSet, brushes(32), "Brush:MaskPen"] [VarSet, brushType(32), 2]
I hope this helps.
This code loops trough all the brushes.
The main problem is that a bunch of dialog boxes shows up.
So hopefully someone else know how to fix this and can combine the scripts
Yeah I know, those are the warnings that shows up when you select a Smooth/Mask/Trim/Slice/etc brush (basically any brush that needs a modifier to be activate).
With he script above those warning don't show up, but honestly I haven't tackled that part of the code: Mark sort that out for me (cause I am not so acknowledge with ZScripting), so I can't tell you how to prevent those warnings to show up.
The script I posted above already account for the 3 most used smooth brushes ("Smooth", "Smooth Valleys" and "Smooth Peaks") that are hard-coded in the script above:
So after that simply press Shift and you will have the smooth brush working with Wrapmode as well.
Can you be more specific? Which one of the 2 scripts doesn't work?
The WrapMode button (that toggle the Wrap Mode on the selected brushes) or the more complex Brush List Wrap Mode (that toggle the Wrap Mode on all the brushes specified in the script)?
I am still using both scripts on both ZBrush 4r7 p3 x64 and also on the new ZBrush 4r8 and they work fine.
If you provide me more details I might be able to figure out what's wrong with it.