ZBrushCentral

Newbie Zscripter Question

Really new at this. Ive got a basic script, but want to make it more functional via buttons or sliders, but cant get my head wrapped around it.

Script Function

  1. Deletes Undo History of selected Subtool
  2. Selects the UV adjustment -10 to +10
  3. Applies the UV adjustment to designated loops

Here’s the script how it stands:

//RECORDED ZSCRIPT 4.6
[IButton,Play,“Press to play this ZScript. ZScript can be aborted at anytime by pressing the ëescí key.”,
[IConfig,4.6]
[IPress,Edit:Tool:DelUH]
[ISet,Tool:UV Map:AdjU,-1]
[ISet,Tool:UV Map:AdjV,-1]
[Loop, 300,[IPress,Tool:UV Map:ApplyAdj]]
]/End of ZScript/

Currently there isnt any user input to this. Tried to figure it out, but never seems to work. Any help here would be awesome

Here’s a sample video of what I’m using it for
https://www.youtube.com/watch?v=8Wytqjmr3ic

http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/#Index

Okay I got the script to function the way I want. Now on to the interface. Time to create the buttons. Here’s the code so far

//RECORDED ZSCRIPT 4.6
[IButton,Play,“Press to play this ZScript. ZScript can be aborted at anytime by pressing the ëescí key.”,
[IConfig,4.6]
[IPress,Edit:Tool:DelUH]
[ISet,Tool:UV Map:AdjU,[StrAsk, “Enter -10 to 10 here”, “How far to adjust U on UV Map?”]]
[ISet,Tool:UV Map:AdjV,[StrAsk, “Enter -10 to 10 here”, “How far to adjust V on UV Map?”]]
[Loop, [StrAsk, “Type Number of Frames in here”, “How many Frames?”],[IPress,Tool:UV Map:ApplyAdj]]
]/End of ZScript/

Probably time to Define a couple variables to hold the info you want to work with. Then, you can use it.
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/technical/

I tried messing with variables, but I couldnt get it working. Tried the string thing a few times and got it to work. Though there seems to be a delay sometimes between the strings till I move the mouse, then the next string pops up. Not sure what causes that.

[VarDef,AdjU,0]//Place to save the number to recall in the script when it runs
[VarDef,AdjV,0]//Place to save the number to recall in the script when it runs

Define the routine to run and then call that routine, there is a script to do all or just visible subtools on the Forums. HTH

The simplest way to do this is to use sliders for the values. This is the sort of thing:

[ISlider,“AdjU”,0,1,-10,10,“Set AdjU amount”,]

[ISlider,“AdjV”,0,1,-10,10,“Set AdjV amount”,]

[ISlider,“Loop Amount”,1,1,1,500,“Set loop amount”,]

[IButton,“Apply”,“Apply adjustments”,
[IPress,Edit:Tool:DelUH]
[ISet,Tool:UV Map:AdjU,[IGet,“zscript:AdjU”]]
[ISet,Tool:UV Map:AdjV,[IGet,“zscript:AdjV”]]
[Loop,[IGet,“zscript:Loop Amount”],[IPress,Tool:UV Map:ApplyAdj]]
]

*Note: when referencing a button/slider in a zscript you use the form “zscript:My_Slider” for the button path. For plugins you’d need to change this to the full button path such as “Zplugin:My Plugin:My_Slider”

Thanks for the advise guys, I’ll put it to use. Appreciate your time.