ZBrushCentral

Place custom button over default button

Hello.

This is another question like “How to set scripted button on default Zbrush menu”. I saw many posts, with opinions that it is impossible.

But I suddenly found that if for example, I write in ISwitch name and path something like

[ISwitch, “Tool:SubTool:Duplicate:Example”, 0, “Info text”, [MessageOK, On], [MessageOK, Off],.5]

[IEnable, Tool:SubTool:Duplicate:Example]

I wil get working scripted element on the Tool Palette.


So, question №1: is there a way to control appearing of custom UI elemen inside of borders of standart UI element? Is it possible to move it down, for example?

And, there is the question №2: as you know, there are some elements in Zbrush, that have same name, If you will store Macro and click on them.

For example, tray dividers have “Divider” name for all 3 of them. Difference is only by ther window Id’s - 1000, 1001, 1002.

So, I can set my scripted divider (and it will be move with standart divider, will work correctly) only over right standard divider that has window ID 1000, that is in right tray (so, it is logical).

I tried to IHide Dividers 1000,1002 and load my zscript, to place custom divider over divider in lefttray (window ID - 1001), tryed to set win ID in IButton’s name, tried many combinations but nothing helps. Zbrush allows to place custom divider over right tray divider only.

Maybe someone (and we all know the name of that someone:)) can solve this problem?

PS: Of course I don’t think I m the cleverest one that discovered SOOO UNIKE trick. I just couldn’t find themes here and in another sites about my problem. Btw, english is not my native language.

PS2: Sorry for my language.

For duplicate, consider adding a preffix to your items like that :

[IButton, "zplugin:my plugin:a.Example",...]
[IButton, "zplugin:my plugin:b.Example",...]
[IButton, "zplugin:my plugin:c.Example",...]

etc…

concerning the custom divider forget about that, it lead, to no where.

FACELESSMINDZ , thanks, but it seems to me you didn’t understand (and again, sorry for my language).

I didnt ask about duplicate with preffix, I use placing scripted switch within the borders of the button Tool:Duplicate only as example. I could place scripted switch within the borders of the button Tool:Delete\Document:Width\etc.

I only asked: is it possible to control appearing scripted element within the borders of standart Zbruch element? Or it is no way to control, scripted buttons can appear over standart buttons but nobody invites the way how to control it?

concerning the custom divider forget about that, it lead, to no where.

I asked the question with fully understanding of useless and absurdity creating buttonsthis way way. But Im very interested in its solution, well… just very interest, hardly get this idea, to create custom divider (get dividers as examples too, there are R buttons in Tool, for example).

Or I would like to make sure that its 100 % impossible. So many times heard that its impossible to create scripted button in standart UI (exept for creating a folder in the bottom of a menu, of course) and now suddenly became it is possible.

Thanks for your answer.

Oh yes sorry i see now what you mean. But anyway this is just the parenting Ui item which allow that, and it just because no lines of code check if Duplicate is a subpalette or not…
It lets you do that, but you can’t do anything else then just what you have done already.
I know you can do that to remake the same thing you can see in document:zapplink properties, where there are overlapping buttons.

Hi,

As you’ve discovered, you can put buttons on top of existing buttons. This can be useful. For example, you could put a button on top of the Save As button in the Tool palette by naming your button “Tool:Save As:Save As” which would allow you to provide different behaviour.

However, to answer your question (1) - there is no way to control where the button is positioned, other than matching the size of the button it is over. (And note that this can change depending on the user’s Preferences>Interface>Button Size setting, so you will need to use proportional values not absolute pixel values (so 0.5 for half palette width, 0.25 for quarter palette width etc.).

For question (2), sadly I also couldn’t find a way to get a button over the other divider. It seems that when the button name is the same then ZBrush just picks the first. (I couldn’t get the ID numbers to work either.)

HTH,
Marcus

FACELESSMINDZ, MARCUS_CIVIS, thank you. After your explanations, i understood these things clearly and will not try to set custom divider onto the standart divider (or custom button onto R button in tool palette).

Btw what is interesting: when I load zscript [Ihide: “any default button”] and then try, for example [IPress: “any default button”] then notise “Interface element could not been found” appears. But when [IHide: 1000], [IHide: 1002] (left and bottom dividers) and after load script [IButton, Divider:Custom Divider…] custom divider doesn’t appear on right default divider.

But by this logic, it should appears :frowning:

MARCUS_CIVIS you will need to use proportional values not absolute pixel values

Thanks! Have done that already.

Btw, I tried that custom divider things just because of the request of my colleague - he usualy click on dividers, but there is a problem with double tap in his Windows 10 because of incorrectly working Windows Ink.

So, this is topic (and zscripting at all) unrelated, but maybe anyone knows how to solve this problem?
Full description on the picture.

Hi,

Your colleague may find the “Tray Left” and “Tray Right” macros in the Macro palette useful for opening and closing the dividers. The buttons can be made part of a custom UI, or hotkeys assigned.

You can actually overlay buttons for the two “R” buttons in the Tool palette by using the pop-up info text (that appears when you mouse over the button) in the button name:

[IButton,"Tool:Restore Configuration:W","Restore",
	[Note,"Hello from Restore"]
,,0.125,,,]

[IButton,"Tool:Reset the selected 'GoZ' enabled application:G","Select GoZ",
	[Note,"Hello from GoZ"]
,,0.125,,,]

But this method won’t work for the dividers because the pop-up info is the same. I imagine that hiding the dividers using [IHide] doesn’t work because ZBrush keeps a reference to the hidden item but I don’t know for sure.

For the Windows Ink and language problems, they are not really something I can help with. Perhaps your colleague would like to contact Pixologic Support where they may be able to help.

HTH,
Marcus

MARCUS_CIVIS, oh, thank you, Marcus, cant even imagine what way you get this information. -1 puzzle for me :slight_smile:

Your colleague may find the “Tray Left” and “Tray Right” macros

Yeah, thanks, at first I wanted to crop them for his UI, but then called to mind about placing scripted elements onto default and decided to try. It turned out so exciting…

Thanks!

1 Like

A lot of trial and error, and I stand on the shoulders of giants. :wink:

1 Like