ZBrushCentral

creating blank spacers in a sub palate UI via script

I am trying compile a bunch of my old zscripts into a UI with multiple sub palates, mainly just for fun.

An issue I’m running into is when I try to use a blank sub palate as a spacer, it creates space at the top and the bottom of the sub palate instead of just the top, where I want the space. Seen here >

Here is what my sub palate spacer code looks like

[ISubPalette, “Zplugin:E Tools:Misc Scripts:Spacer”

,2,07]

What I ideally want is nice clean spacers like the ones shown here >

I’m not sure if what I want is even possible. My thought is that having a blank sub palate inside of another sub palate is what is causing the issue and that it may be unavoidable.

Thanks in advance!

Attachments

space_bad.jpg

space_good.jpg

Should be possible… I just created a bunch of folders inside the macros folder to try and tame things a bit. Files posted at below link. Happy New Year

You can do it with hidden sub-palette and buttons:

[ISubPalette,“ZPlugin:Test Interface”]

[IButton,“ZPlugin:Test Interface:First Button”, “Do It”, 1]
[IButton,“ZPlugin:Test Interface:Second Button”, “Do It”, 1]

//separator
[ISubPalette,“ZPlugin:Test Interface:Separator1”, 2]
[IButton,“ZPlugin:Test Interface:Separator1:Separator”, “Separator”, 1, 1, , 2]

[IButton,“ZPlugin:Test Interface:Third Button”, “Do It”, 1]
[IButton,“ZPlugin:Test Interface:Fourth Button”, “Do It”, 1]

//separator
[ISubPalette,“ZPlugin:Test Interface:Separator2”, 2]
[IButton,“ZPlugin:Test Interface:Separator2:Separator”, “Separator”, 1, 1, , 2]

[IButton,“ZPlugin:Test Interface:Fifth Button”, “Do It”, 1]
[IButton,“ZPlugin:Test Interface:Sixth Button”, “Do It”, 1]

Thank you both!

Marcus your code works perfectly! My issue was that I was trying to group my buttons inside of the hidden sub palate instead of just using the hidden sub palate with a button by themselves for the spacing. Makes perfect sense now!

Is there anyway to control the height of the spacing? Right now it’s a bit too much, ideally I would like the spacer to be about half the size.

Also, I was having difficulty finding much documentation on zscript for UI purposes and specifically information on what all of the commas and numbers mean at the end of a command. For an example your code here >

[IButton,“ZPlugin:Test Interface:Separator1:Separator”, “Separator”, 1, 1, , 2]
Is there anywhere that documents what all of those commas and numbers relate to?

The zscript command reference is helpful but I feel like it just doesn’t go into that minute of detail
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/

Thanks again!

You can’t control the height precisely but you can have about half that by nesting the sub-palettes (with the buttons inside the sub-palettes):

[ISubPalette,“ZPlugin:Test Interface”]

[IButton,“ZPlugin:Test Interface:First Button”, “Do It”, 1]
[IButton,“ZPlugin:Test Interface:Second Button”, “Do It”, 1]

//separator
[ISubPalette,“ZPlugin:Test Interface:Separator1”, 2]

[IButton,“ZPlugin:Test Interface:Separator1:Third Button”, “Do It”, 1]
[IButton,“ZPlugin:Test Interface:Separator1:Fourth Button”, “Do It”, 1]

//separator
[ISubPalette,“ZPlugin:Test Interface:Separator1:Separator2”, 2]

[IButton,“ZPlugin:Test Interface:Separator1:Separator2:Fifth Button”, “Do It”, 1]
[IButton,“ZPlugin:Test Interface:Separator1:Separator2:Sixth Button”, “Do It”, 1]

//separator
[ISubPalette,“ZPlugin:Test Interface:Separator1:Separator2:Separator3”, 2]

[IButton,“ZPlugin:Test Interface:Separator1:Separator2:Separator3:Seventh Button”, “Do It”, 1]
[IButton,“ZPlugin:Test Interface:Separator1:Separator2:Separator3:Eigth Button”, “Do It”, 1]

I’m not sure how much nesting you can do! ZBrush will probably choke at some stage…

For the button code, here are the commas in yellow with comments for each option:
[IButton,“Button Text”,“Popup info Text”
,
/Commands group to execute when button is pressed/
,
/Initially Disabled? (0=Enabled(ByDefault) NonZero=Disabled)/
,
/Button width in pixels (0=AutoWidth NonZero=Specified width)/
,
/Optional hotkey/
,
/Optional button icon (.psd .bmp)/
,
/Button height in pixels (0=AutoHeight NonZero=Specified height)/
]

Additionally the height/width can be specified as a proportion of the palette size where 1 is full width, 0.5 half-width etc., so for height and width values of 0.1 - 1 are proportional and values of 2 and above are actual pixels. In general it’s good to use proportional values as these adjust automatically with different button sizes (as set in Preferences>Interface>Ui).

For the icon a PSD file with transparent background works well - see the main PaintStop button icon file: PaintStopData_4R7_02\BrushIcons\PaintStop-btn.psd

The hotkey option I don’t think is reliable any longer.

HTH,

Awesome thanks Marcus.

I think the nesting of the sub palates with the buttons puts me back to where I was where there is now a bunch of extra empty space at the bottom of the sub palate that I don’t want.

I greatly appreciate you taking the time to help me out though!:+1:

Yes, if you use sub-palettes you get the space at the bottom, there’s no way around that. The interface control for plugins is pretty limited and the code here is mostly creative solutions derived from trial and error. The only other possibility I can think of is to use a disabled button that has a blank name (spaces will work and the tilde ~ won’t show). I used this method in the MME interface, for example just above the “Export Options” button.

[IButton,"ZPlugin:Multi Map Exporter: “,” ",
//spacer
,1,1,12]//end button

This has the advantage of you being able to specify the height, in this case 12 pixels.

Yes, if you use sub-palettes you get the space at the bottom, there’s no way around that. The interface control for plugins is pretty limited and the code here is mostly creative solutions derived from trial and error. The only other possibility I can think of is to use a disabled button that has a blank name (spaces will work and the tilde ~ won’t show). I used this method in the MME interface, for example just above the “Export Options” button.

[IButton,"ZPlugin:Multi Map Exporter: “,” ",
//spacer
,1,1,12]//end button

This has the advantage of you being able to specify the height, in this case 12 pixels. The button will be visible but I don’t find it too intrusive.

This is great Marcus, thank you very much!

I wish there was more of this kind of info out there:D