ZBrushCentral

Accessing some new Zbrush 4R8 UI buttons via Zscripting

Hi guys.
I was playing with my new 4R8 Custom UI and the Preferences:Interface:IMM Viewer:Auto Show/Hide button.
I want that feature to be disabled by default.
Looks like you can only deactivate it if you don’t have an IMM brush selected. I tried to deactivate it, store the config, but no results.
It appears enabled when you run Zbrush, so I tried some scripts, with no results.

I tried:

[If,1,
[IPress,Preferences:Interface:Auto Show/Hide]
]

Also:

[If,1,
[IPress,5550]
]

Anyone know what’s happening?.
Thanks in advance.

EDIT: Same happening with Material:Modifiers:SpecularCurve:Focal Shift (This one drives me crazy).

[IPress] will turn the switch on, not off. Try this instead:

[If,1,
[IUnPress,Preferences:Interface:Auto Show/Hide]
]

Thank you very much Marcus!.
I’m new so I’m trying my best. Did not think about that!.

My other issue appears when I try to access Material:Modifiers:SpecularCurve:Focal Shift

I’m trying this:

//
[ISubpalette,ZPlugin:Hello]
[VarDef,Value,0]
[ISlider,Zplugin:Hello:Slider,0,100,0,100,“Press this”,
[VarSet,Value,[IGet,Zplugin:Hello:Slider]]
[ISet,Material:Modifiers:SpecularCurve:Focal Shift,Value]
]
//

Everything is working just fine, except it only works when I have a non-matcap material selected and I’ve accessed that subpalette manually beforehand.
I recorded a session of actions and got this:

//
[IClick,Material:MODIFIERS:SpecularCurve]
[ISet,Material:MODIFIERS:SpecularCurve:Focal Shift,-75]

//

So I thought this would work:

//
[ISubpalette,ZPlugin:Hello]
[VarDef,Value,0]
[ISlider,Zplugin:Hello:Slider,0,100,0,100,“Press this”,
[IPress,Material:BasicMaterial] // To avoid having MatCap modifiers instead of material modifiers
[IClick,Material:MODIFIERS:SpecularCurve] // must add this here because is not TopLevel
[VarSet,Value,[IGet,Zplugin:Hello:Slider]]
[ISet,Material:Modifiers:SpecularCurve:Focal Shift,Value]
]
//

When I change the value for the first time, It works fine, but when I change the slider again, the script access the IClick part and makes the change in the Focal Shift but also adds a point in the SpecularCurve, resulting in a mess.

Any idea?
Thanks!.

Doing stuff with curves can be tricky. Try this instead:

[ISubPalette,ZPlugin:Hello]

[VarDef,Value,0]

[ISlider,Zplugin:Hello:Slider,0,1,-100,100,“Press this”,
[IPress,Material:BasicMaterial] // To avoid having MatCap modifiers instead of material modifiers
[If,[IExists,“Material:MODIFIERS:SpecularCurve”],

[IClick,“Material:MODIFIERS:SpecularCurve:Close”]

[IClick,“Material:MODIFIERS:SpecularCurve”]

[VarSet,Value,[IGet,Zplugin:Hello:Slider]]

[ISet,Material:Modifiers:SpecularCurve:Focal Shift,Value]

]
,1]

(I’ve changed your setting for the slider resolution and minimum value to reflect the Specular Curve Focal Shift slider.)