1. #1
    New Member User Gallery
    Join Date
    Mar 2005
    Location
    Germany
    Age
    32
    Posts
    20

    Arrow 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.

    [b]Default:[/b] 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

    [b]What I want:[/b] 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

  2. #2
    Senior Member User Gallery
    Join Date
    Feb 2002
    Location
    France
    Posts
    14,107

    Wink Maybe you can try...

    ...Moldy 1.5 or Moldy 2 by Svengali
    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
    No it's not
    So ask some help to Svengali
    Pilou
    Is beautiful that please without concept! ( Me and maybe also E Kant)
    Pilou's Galerie Pilou's Tips Tuts Page
    Cameyo's ZPlace Art Surfing Albums
    Dedicaces Perpetual Challenges

  3. #3
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    7,652

    Default

    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'

    Code:
    [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

  4. #4
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    7,652

    Default

    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:


    Code:
    [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']

  5. #5
    New Member User Gallery
    Join Date
    Mar 2005
    Location
    Germany
    Age
    32
    Posts
    20

    Default

    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.
    [ATT=9672]dynascale.jpg[/ATT]

  6. #6
    New Member User Gallery
    Join Date
    Mar 2005
    Location
    Germany
    Age
    32
    Posts
    20

    Default

    sorry didnt notice your second post...GREAT WORK THIS IS IT

    YOU RULE

  7. #7
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    7,652

    Default

    Thanks.
    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.

    Code:
    [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,

  8. #8
    New Member User Gallery
    Join Date
    Mar 2005
    Location
    Germany
    Age
    32
    Posts
    20

    Default

    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.

  9. #9
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    7,652

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •