ZBrushCentral

Scripting newbie needs some help

Hi there my dear fellows. Im quite new to this whole zbrush scripting and actually not very interested in it. Though i would like to realize the following.

Default: pressing “S” once brings up a tiny bar to change my brush size.
holding “S” and moving the mouse results in flickering of the slider and uncontrollable behaviour of my bursh’s size

What I want: holding down “Space” and moving the mouse from left to right also results in changing size of my brush but without the slider appearing under my cursor.

Could someone please help me ?

Thanks in advance for your time and help

Moldy 1.5 or Moldy 2 by Svengali :slight_smile:
I believe that exist a slider or a short cut for Size brush in it !
If you are just interest in scripting just look the code if this one in txt :slight_smile:
No it’s not :rolleyes:
So ask some help to Svengali :slight_smile:
Pilou

Hi,
What you want is possible but not using the spacebar. If you are happy to use the ‘S’ key instead then you can use the code below. If you wish you can assign another hotkey instead of the ‘S’ but it’s probably worth checking that this won’t conflict with another function - see p.501-3 of the Practical Guide and also the pdf available from within ZB2 help.

To change the brush size using this method hold down the hotkey ‘S’ and move the mouse towards or away from the left edge of the canvas. There’s no need to hold down the mouse button, movement is all that’s necessary. You’ll see that at the left edge the size will be zero.

Copy this code into your text editor and save the file as ‘DrawSizeSweep.txt’

[ISubPalette,zplugin:MorePlugs]

[IButton,Zplugin:MorePlugs:DrawSizeSweep,"Sets DrawSize by mouse sweep", 
	[ISet,Draw:DrawSize,[MouseHPos]]
,,,'S']//this S is the hotkey

Put the file in your …\ZBrush2\ZStartUp\ZPlugs folder and then load it into ZBrush using the ZScript menu load button. It should then appear as a new button in the More Plugs subpalette of the ZPlugin menu and the hotkey will be available every ZBrush session. You should also check out about adding plugins here

As a variation on the above code, this matches the draw size to the document width: left side is DrawSize 1, right side is whatever the maximum is set to:

[VarDef,docsize,[IGet,Document:Width]]
[VarDef,maxsize,[IGet,Preferences:Draw:MaxBrushSize]]

[ISubPalette,zplugin:MorePlugs]

[IButton,Zplugin:MorePlugs:DrawSizeSweep,"Sets DrawSize by mouse sweep", 
	[ISet,Draw:DrawSize,([MouseHPos]/docsize)*maxsize]
,,,'S']

Almost what I want. Thank you very very much though. Yet take a look at the attached image below to see what I am looking for besides your beautiful great script.
Thx again dude.
dynascale.jpg

sorry didnt notice your second post…GREAT WORK THIS IS IT :lol: :lol:

YOU RULE

Thanks. :slight_smile:
Well, you might also like to try this code. Make sure you delete the 'DrawSizeSweep.zsc" file from the ZStartup\ZPlugsfolder before loading the new version.

[VarDef,MPos2,0]

[ISubPalette,zplugin:MorePlugs]

[IButton,Zplugin:MorePlugs:DrawSizeSweep,"Sets DrawSize by mouse sweep",
[VarSet,MPos1,[MouseHPos]]
[If,[Var,MPos1]>[Var,MPos2],
[ISet,Draw:DrawSize,[IGet,Draw:DrawSize]+2]]	
[If,[Var,MPos1]<[Var,MPos2],
[ISet,Draw:DrawSize,[IGet,Draw:DrawSize]-2]]
[VarSet,MPos2,[Var,MPos1]]
,,,'S']

If the draw size doesn’t increment quickly enough change the ‘+2’ and ‘-2’ to larger values such as ‘+5’ and ‘-5’.

Cheers,

Works quite like your previous one. But thanks again. By the way : You should publish that one. Could be quite interesting for people doing speed modelling.

Actually, no it doesn’t. You did delete the 'DrawSizeSweep.zsc" file before loading the new version, didn’t you?

With this version it doesn’t matter where your brush is when you press ‘S’. It can even be off canvas to left or right and sweeping left or right will decrease/increase draw size. And your draw size doesn’t snap to a larger size if you are too near the right edge of the canvas.