ZFileUtils for 4R8


The ZFileUtils, which extends zscript functionality through a dynamic library, has been updated for ZBrush 4R8. This version includes files for only 64bit as there is no longer a 32 bit version of ZBrush.

This version contains the all the functions in the 4R7 version, except for the PasteText function which has been replaced by RenameSetNext allowing the renaming of SubTools, 3D Layers, and Transpose Units.

There are new functions for appending a blank SubTool, creating a Dropdown menu similar to the 3D Text plugin, and for adding translation functionality to your plugin If you wish.

One important thing to remember is that although ZBrush can now handle different languages, your zscript code can’t contain special characters (such as Japanese). The zscript text file still has to be ANSI/ASCII encoded. However, variables can store Unicode strings, so file paths returned by dialog boxes or text strings from StrAsk are preserved and you can use the localization functions to overcome any other limitations.

An example plugin is included in the zip.

Read more and download ZFileUtils here

I hope you find the ZFileUtils useful.

Hi Marcus i post to report a bug with your ZFU_RegisterLocalizationFile.
the issue affect the localization.

here is the thread with the description of the issue :

Best Regards,

Hi marcus, thanks a lot for all your efforts!!!
have a nice day :slight_smile:

Hello Marcus, i come with some feedback on the localization process for plugins.
well everything is working well, at the moment, excepted two important details.

1.Colored strings
\cffffffHaving \cff9925color coded\cffffff strings, do not work.
They must be removed color coded strings from the plugin UI items definition, or the translation will not work for this items.

2.Back to line (
) in Tooltips ( info text), work but
define in English apply for all other language.
ex : if any the english tooltip has a
at the 24th position in the string,
in the french translation, the tootip will get this back to line at the 24th position too.

It stops me from controlling entirely the markup of the tooltip in French translation.

Do you think any thing is possible to fix any of this two things ?

Hi Nicolas,

I’m not seeing either of these problems. What I did notice is that if you use a new line
then the color reverts to white, so you need to put color codes after the new line.

Make sure your text in the translation XML file exactly matches the zscript code. The translated text can have its own colors and formatting. I didn’t get the effect you describe where the line breaks are carried over.Trans-text.jpg



all right, thx you a lot as always, i might have found why the color coded text isn’t working, and now everything is ok about it :slight_smile:
about the other issue mentioned with the back to line, it only happen One Time, for a single tooltip, i can live with that its not much important as that :slight_smile:


me again ;]
i 'd like to post a feature request for plugins
Autonotes for plugin, is that possible ? that would just extend what is declared in Zdata/zlang/english, french etc…
i tested by myslef to edit the autonotes.txt from english en french language, it works for French but not for english.
would be nice to extend this script to build auto notes for plugin.

Autonotes for plugins would certainly be nice, though I don’t know how practical it would be to add in. There may be technical reasons why it wouldn’t be a good idea. But I’ll pass along the request.

Great, let me argument a little bit, why it would be good for.

As you know, my toolset have a lot of buttons which are graphically represented by Icons.
The main issue when using Icon, is that icon also need a Name, especially to create a documentation for my toolset.
This force me, to Edit several time the button tooltips, and as you know for just 2 language supported this same tooltip must to be strictly identical into both xml files ( 3 times in English + one time for the french translation )

actually, it force me to use the tooltip as detailed note, which is giving me hard time making this change several for just one single button item.

I would like to just mention the name of the function/buton item in the tooltip
And use the autonotes to make the descriptions of the function/button item.

The way you define that into a autonotes.txt file is giving a lot of ease to translate a plugin.

I know i am a special case, because no one has ever developed such of huge plugin like me.

Hello Marcus,
i post to tell you that i noticed something wrong with the zFileUtils.
in fact there are two problem :

First issue :
GetpublicFolder path never returns the path of the c:/users/public/documents/zbrushdata2018/
even if both zbrushdata and zbrushdata2018 exists on my system.
i catch the path into a note, and it return.

plugin folder/Zbrushdata/

I 'd tested from my own plugin, but just in case i checked with the compiled plugin from the zfileutils and it does the exact same.

if GetPublicFolder do not work, then i gonna affect the CheckPluginData folder too.

Second bug :
FolderExists fonction do not return 1 like mentioned into theofficial doc.
it always return -1 when the folder exists, and 0 if not.

So can you tell me what wrong with these functions ?

Hi Nicolas,

  1. The ZFileUtils hasn’t been updated for 2018 but the function will work OK if you change the zscript code. If you look at the ZFileUtils_TestZScript_4R8.txt and find the code for the GetZBrushDataFolder button you’ll see that the ZBrush Data folder name is simply appended to the Public folder. So all you need to do is change “ZBrushData” to “ZBrushData2018”. (You would do the same for the CheckSharedFolder routine.)

  2. Thanks for pointing that out. I’ll correct this in the next update. But as 0 evaluates to false and -1 to true it doesn’t make any difference.


all right, that works now Thank you a lot again Marcus.

first issue:
i am using 2018.1, and about the GetPublicFolder, it’s really strange cause I still have the R7/R8 ZbrushData in my public/documents directory, as i did not appended the 2018 to that variable in the script it did not worked.
But works when i append zbrushdata2018 like you asked me to do it.
I know zFileUtils hasn’t been updated after the 2018 release, so i thought it will not be an issue to check ZBrushdata instead of ZBrushdata2018. But nevermind as it works now, that the most important.

Concerning the first issue do it wouldn’t be better to pass the version we are looking for to the dll and return the full path ?
So for R7 andR8 user it would return ZBrushdata and for 2018 it would return the path to ZBrushData2018

second issue :

Now about the second bug, yes that just mind blowing, i thought in order it would be something like that :
-1 = error, 0 = folder do not exists, and 1= folder Exists.

Thank you for a quick answer Marcus !