ZBrushCentral

ZFileUtils - a resource for zscripters

The ZFileUtils DLL is a resource for zscripters that provides extra functionality between ZScript and ZBrush. The DLL will continue to be developed and expanded so that zscripters can add greater sophistication and enhancements to their zscripts and plugins.

To download and read more about ZFileUtils see the Wiki documentation here.

Several of the functions in the ZFileUtils are made use of in my SmoothGroupImport plugin.
Of particular interest will be the ability to specify a default folder for a file Open Dialog. By saving a file path to disc the plugin sets the dialog to open in the last used folder.

Another feature is the ability to place a plugin button in a specific place on the ZBrush interface using the ‘MoveButtonAfter’ function (though note that this will only work for buttons that are part of the UI on start up).

The ZFileUtils provides a number of functions that work with OBJ files. Note that as the OBJ has to be loaded into the DLL, and thus takes up memory, it should be ‘freed’ as soon as possible after use so that the memory is made available for other programs (including ZBrush). Not freeing the OBJ would lead to a memory leak.

I’m providing the code for SmoothGroupImport so that those interested can see how the various functions work. I hope you find it interesting and the ZFileUtils useful.

IMPORTANT: ZFileUtils was written for ZBrush 3.1. Some functions will not work correctly with later versions of ZBrush and may cause the program to crash.

ZFileUtils? That sounds a little bit cool… Better have a look. Thanks MC!

Sven

Hi, I’ve been asked to see if we can better integrate ZBrush into our pipeline so I’ve been investigating ZScript and especially the interface to DLLs.

I’m curious about your ZFileUtils because it seems like functions in that DLL have the ability to modify the Mesh3D in ZBrush. For example this:

[VarSet, err, [FileExecute, [Var,dllPath], SetMesh3DFromOBJSmoothGroup, “crease”,n+1]] // 1-based.

SetMesh3DFromOBJSmoothGroup seems to be able to set creasing on the current Mesh3D. How do you accomplish this?

From everything I’ve seen, FileExecute is the only real way to communicate with a DLL and ZBrush doesn’t seem to ship with any C headers or C API that I can find.

So how is it done? This is the sort of thing we’d like to be able to do.

Thanks!

Jeff,

The link in my first post and the attached text file show how that particular function is used through zscript. However, please note that the DLL will need updating before it will work with ZBrush 3.5, and I’m not sure when that will be.

There is currently no ZBrush SDK and it’s not possible to write user DLLs that directly manipulate ZBrush data. DLLs can be written that manipulate data outside ZBrush but the standard import/exports need to be used to bring the data back into ZBrush.

The upcoming GoZ feature (already available on MacOSX) is designed to simplify moving between ZBrush and other 3D apps. Pixologic are working to add to the list of supported applications, and an SDK for GoZ will be released as soon as it is available. GoZ may be the best way for you to integrate ZBrush into your pipeline. For more information see the Pixologic website.

HTH,

Hi Marcus! Happy new year my friend!
just for curiosity: the zscript is working in ZB 3.52?
Thanks in advance
Andreseloy

Hello Mario,

I hope you are well, and a Happy New Year to you and your family.

For the ZFileUtils, I’m afraid some functions will not work with ZBrush 3.5 R3 (such as the smooth group import demonstrated in the zscript).

Cheers,

Nooooooooooo. Does anyone know a workaround for this? I can’t live without this plugin! It was so nice and I thought it was supposed to be included in R3? (just noticed it’s nowhere to be found.) So disappointing.