ZBrushCentral

Simple noob script help needed please.

Ok, so i am reading about scripting but its way too complicated for me (my english is bad and that is not helping).

i already learned to make some macros and its wonderful!!

But what i need is:

For example the “use tablet” button: a toggle button wich is too largue.

So i made a macro wich disables it:
//ZBRUSH MACRO - Recorded in ZBrush version 4.8
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,4.8]
[IUnPress,Preferences:Tablet:Use Tablet]
]

It disables it, but i does not enables it. So i suppose i must make a check with “IF”, too see its state, and then enable or disable it as needed?
I am not sure how to do this (im reading about “if” and “else” but cant figure it out.

More on that, is it possible to change the color? so i know when the button is pressed or not?

Thank you!
If the is a resource you think can help me, please share the link and ill try :slight_smile:

Ok i finally did it like this:

//ZBRUSH MACRO - Recorded in ZBrush version 4.8
[VarDef,tabletMode,0]
[IButton,???,“Press to Enable/Disable Tablet Pressure.”,
[IShowActions,0]
[IConfig,4.8]
[VarSet, tabletMode,[Iget,Preferences:Tablet:Use Tablet]]
[If,tabletMode = 1,
[IUnPress,Preferences:Tablet:Use Tablet]
,
[IPress,Preferences:Tablet:Use Tablet]
]
]

It seems to be working. Now i can delete the use tablet button from my ui, and use this one (much shorter)
Now i need a way to change the colour…

Im stuck

Anyone please?

Much easier than the code above:

//ZBRUSH MACRO - Recorded in ZBrush version 4.8
[IButton,???,“Press to Enable/Disable Tablet Pressure.”,
[IShowActions,0]
[IConfig,4.8]
[IToggle,Preferences:Tablet:Use Tablet]
]

I need to know if a color button can be changed please. Just as the normal Zbrush toggle buttons (Grey and when you activate it, it becomes red; if deactivated = grey again)

Can it be done?

Thank you.

nope you can’ tto change the switch button color, you can only change the color of every switch button via preferences > icolor section

nope you can’ tto change the switch button color, you can only change the color of every switch button via preferences > icolor section

Thanks Foceless for the aclaration, much appreciated.

Anyway… it seems weird that an incredible program like Zbrush cant make a button light up :confused:

Edit: Some plugins are actually doing this…
mmb.jpg

Finally Made it

[ISubPalette,“Zplugin:Tukor Buttons”]
[ISwitch, “Zplugin:Tukor Buttons:UseTablet”,1, “descriptionhere”,
[ISet,Preferences:Tablet:Use Tablet,1]
,
[ISet,Preferences:Tablet:Use Tablet,0]
]

Saved in the macros folder.

That made a new palette in zplugins called Tukor buttons wich has a button inside called UseTablet.
Now i drag that button to my UI, and it switches on and off.

Thanks :slight_smile: