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.