ZBrushCentral

Question: Is there any zscript method to get a temp path for exporting file for other program?

I saw there’s a method called GetPublicFolder in the document ZFileUtils | ZBrush Docs about Creating a Public/Shared plugin Data folder.
But it as I call MakeFolder with the path which contain multiple layer, it won’t create the folder, and when I use the MemSaveToFile, it actually save the file to a relative path where my macro file is instead of location where MakeFolder execute.
I wonder if there’s any method to get a path that can be used as temp folder.

You can actually use a specially form which is expanded by ZBrush. So:

[VarSet,myDataPath,[FileNameResolvePath,"ZPUBLIC_Temp/mydata.dat"]]

would expand to “C:\Users\Public\Documents\ZBrushData2022\Temp\mydata.dat” on Windows. Likewise:

[VarSet,myDataPath,[FileNameResolvePath,"ZPUBLIC_ZPluginData/mydata.dat"]]

would expand to “C:\Users\Public\Documents\ZBrushData2022\ZPluginData\mydata.dat”.

HTH,
Marcus

Thanks, it helps a lot.

Hello Macrus,
could you provide more of these “ZBrush variables” like “ZPUBLIC_Temp” or “ZPUBLIC_ZPluginData” please ?

Some link to documentation, whatever :wink:

Hi Vilbur,

Welcome to ZBC! :slight_smile:

ZPUBLIC_ gives you the Public\Documents\ZBrushData2022 folder (or the equivalent on MacOS and for later versions of ZBrush), so you can combine it with any of the subfolders such as Temp, ZPluginData, QuickSave, ZStartup etc., in the same way as my examples above.

ZBRUSH_ will give you the root installation folder for ZBrush and can be combined with any of the subfolders such as ZExportImport, ZMaterials, ZProjects, ZStartup etc. So if you wanted the path to a dynamic library in your plugin data folder you might use:
“ZBRUSH_ZStartup\ZPlugs64\MyPluginData\ZFileUtils64.dll”

HTH,
Marcus

Thank You Marcus ! :+1: