ZBrushCentral

[Question] Hide UI prompt when calling [IReset]

I have a simple script that imports an obj into zbrush. I call [IReset] at the start so my interface is reset.

However, this brings up a dialog box asking me to confirm if I would like to “initialize and continue”

Is there a way to confirm yes in the script or hide the UI and go with the default?

The same happens if I try to call “new document”.

Sorry if this is obvious - noob zscripter here!

As I understood, you want to automatically press “Initialize and continue” button when prompt “ZScript is requesting to fully initialize ZBrush” floats? If yes, try this code.

[IKeyPress, ‘1’,[IReset]]

BUT zbrushcentral somehow changes apostrophes, if you’ll copy the code change them as on screenshot.

радикал фото

I am a noob to, but it works, I just check it.

By the way, when I use [IReset] command, open a new document and try to load a tool, my ZBrush 2021.1.2 crushes with “sorry an unrecoverable error” message.
Only I have this problem?

If it is important, here is the code, creates .txt file in ZBrush 2021\ZStartup\Macros\Misc

[IButton, “???”,“test”,
[IKeyPress,‘1’,[IReset]]
, /image/,]

And a noob questions from me, just to not create a new topic:

  1. Why this trick works with, for example [IReset], works with smooth/mask/select brushes (everyone remember Marcus’s Off messages plugin :)) but do not works with the brush Morph? I want to disable the note which appears when I click on the canvas without Morph Target storing (automatically click on “Skip this note until next restart”).

image

I tried, different ways, for example:
*[IPress,Brush:Morph] *
[IKeyPress,‘2’]
[IClick, 1004, 100, 100]
and
*[IPress,Brush:Morph] *
[IKeyPress,‘2’, [IClick, 1004, 100, 100]]
But noone works.

  1. Is it safely to create sliders, switches and another elements in ZBrush 2021\ZStartup\Macros\Misc folder? I had never seen anybody who creates something exсept of buttons in this menu.

I created some sliders and switches in this menu, 2-3 month ago, and they still work properly (or I do not see the troubles).

Hi ARJUNA_RAVIKUMAR,

Welcome to ZBC!

For resetting the ZBrush interface without the pop-up then I’d use:

[IKeyPress,13,[IPress,Preferences:Init ZBrush]]

The “IKeyPress,13” simulates the pressing of the Enter key.

As KOTOVSKY_938 says, for some dialogs you can use ‘1’, ‘2’ and so on with IKeyPress to simulate pressing the first button, second button etc. of the pop-up.

I prefer Init ZBrush because IReset will crash, as you have observed.

KOTOVSKY_938,
I think probably the problem you are having with the morph brush is because it has to be clicked on the canvas before the pop-up appears and that can be very difficult to zscript and get rid of the message. I will take a look to see if I can find a way.

I don’t think there’s any reason that having stuff in the Macros palette would cause a problem, although you could create a plugin with all the things you want which would be tidier. See here if you are interested:
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/interfaces/zplugin-interface/

HTH,
Marcus

2 Likes

Hi KOTOVSKY_938,

I found a way to turn off the Morph brush pop-up. If you draw out a model on the canvas when the Morph brush is selected then the pop-up will show. Fortunately IKeyPress will work when you do this. I’ve attached a macro that you may be able to adapt for your needs. This example will only work if a model is in Edit mode before you press the macro button.

Morph_Brush_popup.txt (656 Bytes)

HTH,
Marcus

1 Like

Hi, MARCUS.

Oh, you are that quick… Thanks, but I’ve already got the way (even two ways) how to manage with the Morph Brush.

My ways are at the video below, if you or somebody interests, I even add a note like “Turn on Morph target?” that turns on MT by click on “Ok” (or, as everyone knows, by tap Enter button - very useful, IMHO).

Will learn your code (and this is not just politeness, as I can see on the fly, you use some interest zscripting methods :)).

Also, thanks for education about sliders and switches in Macro palette, just there isn’t any slider or switch in default ZBrush macros, only buttons, so I had doubts.

1 Like

Thank you Marcus and Kotovsky! That was helpful indeed :slight_smile:

2 Likes