ZBrushCentral

laying out SubPalettes?

I’m looking for some more information on subpalette/UI stuff, I’m curious how marcus got some of the results for his reference image subpalette…
I cant seem to control the arrangement of the elements.

thnx

There’s not really a lot of control of how the buttons can be arranged but you can specify width and height. As a result, you may need to truncate your button titles to get them to display nicely. For sizes, I use a width of 76 and height of 19 to get two buttons side by side in the palette of the same size as the standard ZB ones.

If you say what you are trying to do I’ll see if I can make any suggestions.

If you can visualize the process as an upside down version of Tetris where blocks flow upwards, from the left hand side, and slide to the right if they can fit, then you are half way there. The blocks are of course interface items (Buttons, sliders, switches) and give a much higher satisfaction than Tetris ever could when you clear a line :wink:

Constructing a collection of interface items within a subpalette might seem daunting, especially if you have never tried it before. It can be very confussing. But luckily there are four rules to help you out.

    <b>1 :large_orange_diamond:  </b>Placing interface items in a subpalette is done in a left to right order. This might seem obvious but it affects all the rules below. There is no way to reposition an interface item in a subpalette except by adding additional subpalettes or adding disabled interface items, which is beyond the scope of this reply.
    
    <b>2 :large_orange_diamond:</b> Your SubPalette has a certain width. One or more interface items must fit within that width, otherwise they are placed to the left and below the previous interface item(s).
    
    <b>3 :large_orange_diamond:</b> The first interface item on any given 'row' determines the max height of the following interface items. If the next interface item is not equal to or lesser in height it will be placed below and to the left, even though it might fit width-wise.
    
    <b>4 </b>:large_orange_diamond:  Interface Items will always try to squeze into the smallest gap if their width and height permits them to. That means that interface item #3 might fill a gap that interface item #2 could not.This does not change the order of your script code, just the visual side of it.
  

    The best way to construct a subpalette interface is to actually draw it on paper. A level 1 subpalette, for example <b>Zplugin &gt; Zbrush Help,</b> has a max width of 152. The best thing to do is then plan on paper your buttons/switches/sliders, and their widths and heights.

So you can see there is a way to control the interface item placement disorder. The only problem is the totalitarian style control required, which leaves little room for imagination. But it is very satisfactory when it all works.

    Anyone for a game of Tetris?

Thank you so much for clarifying this command TVeyes :>

And to be more specific marcus, how did you get those icons on your buttons in the subpalette? :stuck_out_tongue:

You can use an image for your plugin button (just as you can for zscripts). In this case they are stored in the RefIMage_data folder. Here’s the code:

[IButton,"Layer:Reference Image:BK","Click to reposition model. \CFFFFFFSHIFT\CFF9923-click to store.",
//button commands here
,,38,,"RefImage_data\Back.psd",38]