ZBrushCentral

ZBrush DLL Question

Hello there,

I was reading primers on ZBrushCentral for how to create DLLs for ZBrush, and how to get them to run. I know I use [FileExecute] to call the DLL and pass functions to it. But my question is:

How do I get my DLL to ‘communicate’ with ZBrush? Let’s say I want my DLL to execute ZScripts from its side of things. How would I go about doing this? An example is shown in the pseudocode below:

string cmd = "[ZScript CommandA]
                           [ZScript CommandB]";

ZbrushWindow.ExecuteCommand(cmd);
[...]

I have a script that speeds up my pipeline quite a bit. But the problem I face is in its call to UVMaster. Since that is a separate script, my script will terminate the minute it’s called.

I want to find a workaround for the ‘one zscript at a time limitation’. I figure if I can get my script working, I can call THAT, then send it over to the DLL to call the 2nd command in another script, and then return execution back to ZB or something along those lines.

I also know python, so if that has to be a recommended route, I’ll use it. But I also know that not everybody has Python installed on their system. So yeah.

Can anybody help me out? Thank you kindly. :slight_smile:

You can’t to remove that limitation as long as you have no access to the code of UVmaster Zscript.

Hope it helps,
Nicolas

Hi,

Welcome to ZBC :slight_smile:

Another problem with the DLL approach is that if you call a DLL from zscript then the zscript pauses while it waits for the DLL function’s return value. It may be possible to call a new zscript from a separate thread, I don’t know but also there is the problem of monitoring what is happening. As UV Master doesn’t output a file it would be difficult to tell when it had finished. (I know of people using python to write a zscript, call ZBrush with the zscript and then watch for a file to be created.)

I have written a version of UV Master that will return control to the calling zscript, enabling batch processing. The calling zscript has to work in a specific way so that this will work but it is not difficult and I provide an example. Send me a PM if you would like to try it.

Marcus

Hey @marcus_civis can you DM me that version of UVmaster please ?