ZBrushCentral

Script to multiply Tool:Geometry:XYZ value by 2

I am trying to write a scrip to get the value f the Tool:Geometry:XYZ value and multiply it by two. I wrote this but its not loading, can some one tell me whats wrong with it . Thanks

[VarDef,size,0] //defines a variable to store Edit mode
[IButton,“SCALE UP”,“Scale X 2”, // creats button
[VarSet,size,[IGet,Tool:Geometry:XYZ Size]] //set variabel to size
[ISet,Tool:Geometry:XYZ Size,(size*2)] // multiplt scale by 2
]

Update to original post:

So I changed the button name of this script to testup
[IButton,“testup”,“Scale X 2”, // creats button

when I use rload all macros the button does not show up as before
but if I load the script from the script palet
the button shows up in the script editor and the script work
but how can I get the button to y interface? I guess some thing is still wrong with the sript?

Update two"
So in experimenting with this I looked at a script I recorded in zbrush and substituted that format (took out the button line) and ended up with this which loads the button into the macro pallet and the script works. So If some one can just explain what I did wrong initially I would appreciate it, Thanks

Good working script:

//ZBRUSH MACRO - Recorded in ZBrush version 2021
[VarDef,size,0]
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,2021]
[VarSet,size,[IGet,Tool:Geometry:XYZSize]] //set variabel to size
[ISet,Tool:Geometry:XYZ Size,(size*2)] // multiplt scale by 2
]

//ZBRUSH MACRO - Recorded in ZBrush version 2021
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,2021]

[VarSet,size,[IGet,Tool:Geometry:XYZSize]]
[Note,size]
[ISet,Tool:Geometry:XYZSize,size*2]
[VarSet,size,[IGet,Tool:Geometry:XYZSize]]
[Note,size]
]

1 Like

Hi Zolly,

For ZBrush to recognize your script as a macro the button name must just be three question marks:

[IButton,???,"What this button does",
//code
]

You also need to save the text file to the ZBrush 2021\ZStartup\Macros\Misc folder.

If you give your button a name then you need to load it through the ZScript:Load button and it will appear at the bottom of the UI in the “ZScript Window”. Pressing ‘H’ on the keyboard will show this window.

If you want to create a plugin then you need to name the button in a special way described on this page:
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/interfaces/zplugin-interface/

HTH,
Marcus

Thanks very much for your help!

1 Like