ZBrushCentral

Send data from external application to ZBrush

Hey guys,

I am trying to create a project manager application for ZBrush for work and was hoping you guys could help me out.

What would be the best way to send user inputted data from a external C++ application to ZBrush. Right now I am trying to automatically set the save path of ZBrush based on the project a user has selected in an external application?

Thanks

For a separate application you’d need to launch ZBrush with a zscript file using (on Windows) ShellExecute. The zscript would then need to do what you want, perhaps reading any necessary data from a file written by the external program.

Setting a save folder is tricky. You can’t do it directly, so that users pressing the File>Save button automatically get the folder you want. You’d have to have a plugin button that users used instead, which would contain a bit of creative scripting:

[VarSet, resetZFolder,0]
[If,[IGet,Preferences:Misc:Use ZFolders]==0,
[ISet,Preferences:Misc:Use ZFolders,1]
[VarSet, resetZFolder,1]
]

[VarSet,saveFolder,[FileNameResolvePath,“ZBRUSH_ZExportImport/Test.zpr”]]
[VarSet,fileName,[FileNameAsk,“ZProject(.zpr)|.ZPR||”,saveFolder,“Please Save File…”]]
[If,[StrLength,fileName],
[FileNameSetNext,fileName]
[IPress,File:Save As]
]

[If,resetZFolder,

[ISet,Preferences:Misc:Use ZFolders,0]

]

The “Use ZFolders” button has to be turned on otherwise the folder defaults to the last used.