ZBrushCentral

Import into Subtool from last visited IMPORT folder (scripting possible?)

Hello,
I am importing frequently OBJ’s and have each time to navigate to the nested folder again and again. (This behaviour of not remembering used folders is so bad, no idea why it still wasn’t improved after years… Maybe the typical zBrush user doesn’t import or export or is a Zen master)

But once you provided me kindly a script, that remembers the last “export” folder.
I have attached it here below. Unfortunately I’m not able to understand how to write something like this.
Would it be possible to create a similar script, that remembers the last IMPORT folder, too?

Thanks for help!

The Export folder script, which is one of my most important scripts in zBrush:

//ZBRUSH MACRO - Recorded in ZBrush version 4.8

[IButton,???,“Export current mesh as OBJ using Maya settings”,
[IShowActions,0]
[IConfig,4.8]
[If,[IsEnabled,Tool:Export],
[VarDef,filepath,“ZBRUSH_ZExportImport”]
[If,[FileExists,“LastFolder.dat”],
[MemCreateFromFile,ExpLastFolderMem,“LastFolder.dat”]
[MemReadString,ExpLastFolderMem,filepath,0]
]
[IUnPress,Tool:Export:Grp]
//[IUnPress,Tool:Export:Mrg]
[VarSet,zF,0]
[If,[IGet,Preferences:Misc:Use ZFolders],
[VarSet,zF,1]
[IPress,Preferences:Misc:Use ZFolders]
]
[VarSet,toolName,[IGetTitle,Tool:Item Info]]
[VarSet,filePath,[StrMerge,filePath,toolName,“obj”]]
[VarSet,fileName,[FileNameAsk,“OBJ (.obj)|.obj||”,[FileNameResolvePath,filepath],“Export as OBJ”]]
[If,[StrLength,fileName],
[MemDelete,ExpLastFolderMem]
[MemCreate,ExpLastFolderMem,256]
[VarSet,folderStr,fileName]
[VarSet,bwritten,[MemWriteString,ExpLastFolderMem,[FileNameExtract,folderStr,1],0]]
[MemResize,ExpLastFolderMem,bwritten]
[MemSaveToFile,ExpLastFolderMem,“LastFolder.dat”,1]
[FileNameSetNext,fileName]
[IPress,Tool:Export]
]
[If,zF,
[IUnPress,Preferences:Misc:Use ZFolders]
]
]
,0.25]

Hello @AlexxCentral

You might try over in the Scripting Help forum, and see if @marcus_civis or any of the other scripting experts can help you out.

:slightly_smiling_face:

thanks, yes it’s anyway from Marcus, I remember now :wink: