ZBrushCentral

ZFileUtils updated for 4R7 - March 4 2016

Hi,

The ZFileUtils, which extends zscript functionality through a dynamic library, has been updated for ZBrush 4R7. This version includes files for both 32bit and 64bit.

If you are updating a plugin then please check the included sample zscript, especially on how to get to correct file path for 32bit/64bit. When creating a plugin for both versions of ZBrush 4R7 you will need to install your plugin both in the ZStartup/ZPlugs folder (for 32 bit) and in the ZStartup/ZPlugs64 (for 64 bit). The CheckSystem routine included in the zscript example shows how you can use a single zscript for all installations.

With this new version, another thing to consider is how your plugin handles any temporary files it needs to write. ZBrush and its plugins now write all temp files to folders within the ZBrushData folder located in the Public/Shared folder. In a typical installation this will be at C:\Users\Public\Documents\ZBrushData on Windows and at /Users/Shared/ZBrushData on MacOSX. Plugins write to their own folder inside the ZBrushData/ZPluginData folder, and the new ZFileUtils documentation shows how you can add your own plugin data folder if you wish. It’s not essential that you follow this route but writing to the Public/Shared folder can avoid file read/write permissions issues.

Read more and download ZFileUtils here

Latest version - March 4 2016 - adds function for renaming Layers/SubTools

I hope you find the ZFileUtils useful.

AWESOME :+1: :+1: :+1: THANK YOU

Couldn’t wait for it and wrote my own version of ZFileUtils64…
Came to forum to post it and yeah here we go I have found original already uploaded!
But nothing lost… at least I have learned how to write dll’s for zbrush :stuck_out_tongue_winking_eye:

Thanks Marcus!

Doug and Piosio,
You’re welcome.

Well, that’s great, of course, and will open up other possibilities!

Thank you Marcus, much appreciated :+1:

Do you happen to know more about the read/write permission issue and when that might appear? I seem to remember some people having weird problems in general where the read/write permissions turned out to be the culprit, but not in relation to zplugins. Is it a common issue still? Or maybe just an occasional occurrence due to overzealous IT departments?

I just realised that my Mac ZBrush installation is for all users on this machine, but I can’t remember if I selected that option myself or if it even was a choice. Which would make my concern irrelevant. In any case, for some plugins I would prefer not to use the shared folder for storing data as it may contain credentials specific to the currently logged in user.

Hi Mark,

I honestly don’t know how often it’s been an issue but I know that it has cropped up in Pixologic Support often enough for ZBrush to move all its temp files to the Shared/Public folder. I think that mostly it’s been in schools or studios where users do not have administrator privileges.

HTH,

Ok, that would make sense. Thanks. But would that not mean most zbrush users login to their computers with administrative privileges? Naughty, naughty ZBrushers indeed. No presents for you :smiley:

Hi Marcus, I remember the GOUVLayout script loosing its wind and grinding to a halt because of there was no 64Bit version of ZFileUtils to make the transition to r7 64Bit. Now that this is available I am hoping the much needed ZBrush 4r7 64Bit bridge to the Headus UVLayout app might come back to life?

Hi JayBass,

That script was developed by a user who doesn’t seem to have been to ZBC for a while. He did post his code though, so it may be possible to get the script working OK with 64bit ZBrush. I’ll take a look next week and PM you when I have something for you to test (I don’t have UVLayout).

Thanks for the speedy reply Marcus, that would be totally awesome.
UVLayout can be downloaded free as a trial with the limitations being only less internal app functionality, but does give full save and all basic application options, all one really needs for successful “Plugin” testing. And it is 12mb in size as a windows install or 16mb for Mac.

http://www.uvlayout.com/index.php?option=com_wrapper&Itemid=72

I am also willing to test the hell out of it and provide solid feedback for as long as you are willing to give it steam.

Only have Windows though(64 & 32), I do have some friends that use it on Mac who would test along side me.

Thanks JayBass,

I’ve sent you a PM.

I’ve made a small update to the ZFileUtils to include a new function"PasteText" for renaming 3DLayers or SubTools. Many thanks to TVeyes for the idea on how to achieve this, as he explains in this thread.

hey Marcus, why to not put the full code on Github ?

It was great, can not wait for it and wrote my own version of ZFileUtils64

Hiya Marcus, I’m writing a plugin to make exporting to substance easier. One thing I need to achieve it is a way for the user to select a destination folder. So far I can only find a way to allow the user to select a file. I’m after the normal file explorer (with Quick Access etc) but instead of it only working on file select, you could select a folder. Some apps show the janky little folder tree selector dialogue, I’d like to avoid that :smiley:

One reason I’m after this: subtool master’s export all requires you to enter at least a letter into the dialog, and then prefixes your files with that. I need to, among other things, match the filename and subtool name. I have the export part working, but I can’t find a way to allow the user to select a folder that isn’t something hacky like selecting a dummy file that sits in a target folder already, and pulling the path from that.

Thanks for reading!

As per bakedbean’s suggestion, I’ve updated ZFileUtils to include a function to launch a Select Folder dialog. See here:
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/zfileutils/#selectFolder

Any problems, let me know.

Thanks again for get folder Marcus! It worked great for my exports of objs to Substance Painter. With a little more cleaning up I’ll post a few painter related macros for everyone.

I tried a few different ways to escape strings so I could echo the path in a note, but I’m guessing the font used on the notes doesn’t have a backslash at all? String replacing it with underscore did the job.

bakedbeing,

That’s great :+1:

Yes, the backslash simply doesn’t display but you can substitute with forward slash, or underscore as you’ve done.

Hi Marcus, any progress on 4R8 ZFileUtils?

Cheers!