ZBrushCentral

Question: Need help on deleting subtool while bypassing the confirm window.

Hi,

I could use some sanity check here. In the code below, I wanted to delete a subtool via zscript. I found this Zbrushcentral post which Marcus Civis showed how it’s done:
http://www.zbrushcentral.com/showthread.php?184857-Script-a-button-press-on-a-dialog

I refitted his simple one liner code for my purpose:

[IButton,Blah,“Blah”,

[IKeyPress,13,[IPress,Tool:Subtool:Delete]]
[Note,“Blah”]
]

I feel like my memories are playing tricks on me. The code doesn’t work currently. Zbrush simply ignores the subtool deleting and goes right to the Note part. But when I was developing my script in the beginning, I thought I saw it working. Am I wrong?

I’m afraid there’s currently no way to get rid of those dialogs using zscript. The [IKeyPress,13] solution, which simulates pressing the Enter key, will only work when pressing Enter gives the desired result. In this case it simply cancels the dialog.

I do have a kind of solution using a DLL which I may add to the ZFileUtils if I get it working for Mac OSX. It simulates a mouse click on the relevant dialog button. If you want to try it on Windows (for testing purposes only) then send me a message.

Thanks Marcus, for verifying that for me so I can keep my sanity! I will hit you up for that dll once I get a little bit of free time away from work. Much appreciated!

Hi sorry if I’m hijacking the thread but currently we have a script for zbrush that we’re using at the studio I work on that I’d like to change if this or similar was possible.

I’m running batches of 200+ frames through zbrush with a script but I have to close and reopen zbrush every time because we can’t seem to be able to “force delete” ztools through zscripting or “force create” a “new” scene in zbrush as it comes up with a dialog box as well.

Is this still the case if we don’t care about the rest of the scene, is there a way to forcefully delete everything? (without having to accept any dialog)

The time zbrush spends launching and closing is really taking up a significant amount of time considering that it takes roughly the same as the actions we run in the script itself.

Hi exavi,

One way you could do it is to have a blank project that you load in whenever you want to clear ZBrush of all tools. (Textures and alphas won’t be cleared.) In order to avoid the dialog box asking to save the current project you can use code like this (which loads in the DemoDog project as an example):

[FileNameSetNext,"ZBRUSH_ZProjects/DemoProjects/DemoDog.zpr"] [IKeyPress,'N',[IPress,File:Open]]

I use method marcus gave you with empty project instead of initialise button to get rid of all subtools.

But if you want delete only one subtool by script before you launch your script you have to manually delete some subtool then hit the button “Always OK (skip this note until next restart)” when the zbrush pop up window appear.
After that you can use [IPress,Tool:Subtool: Delete] without [IKeypress] and you should be able to delete subtool from now by your script until next restart of zbrush.

Your script went straight to the [Note] line because [IkeyPress] was just dismissing the initial zbrush popup window asking you for confirmation of your actions that appear always when u try to delete subtool untill you click “Always OK (skip this note until next restart)”

[IKeyPress] works only with system popups not with zbrush ones.

Hope that helps…

Cheers!
Piosio

Hi, new member here, Tech Artist.

MARCUS_CIVIS mentioned a way to bypass the input boxes that appear when trying to perform some actions…

Im currently trying to create a batch importer-processor-exporter script. But im having trouble figuring out how to bypass the input boxes. I downloaded the latest Zutils but i couldnt seem to find a solution there.

Was the workaround that you mentioned added ?

1 Like

I’m in a similiar situation. Am also working on an batch import-process-export script, and every time I load my script for the first time after starting z-brush, an unwanted window pops up that I want to automatically bypass.

Updating this topic since there’s now a way to get rid of confirmation dialogs. All you have to do is use IKeyPress ‘3’ and it’ll click on the third button. Examples below:

To choose ‘Always OK’ for the delete confirmation so it never shows up again in the same session:

[IKeyPress,'3',[IPress,Tool:SubTool:Delete]]

For merge down:

[IKeyPress, '3',[IPress,Tool:SubTool:MergeDown]]