Hello!
I’m trying to write/modify a Zscript to batch export all subtools with subtool names intact. I currently have a working script that goes through every subtool, exports, and has me choose a location/name for the obj. The issue is that I would like to automate this so that I only have to choose the folder location once on run, and then the script would export every obj to the location of the selected folder with the subtool name set up.
Here is what I have so far.
[VarDef,activST,0]
[VarDef,filePath,""]
[RoutineDef,CheckVersion,//check that version is 4R8
[If,([ZBrushInfo,0]< 4.8),
[Note,“This script is not for this version of ZBrush”]
[Exit]
]
]//end of routine
[RoutineDef,CheckSubTool,//check that we have a subtool
[If,[IExists,Tool:SubTool:Select Down],
//do nothing - all OK
,//else not a subtool
[Exit]
]
]//end of routine
[RoutineDef,DoItGRP,//start of routine
[IKeypress, 13]
[IUnPress,Tool:Export:Grp]
]//end of routine
[RoutineDef,DoItExp,//start of routine
[IPress,Tool:Export]
]
[IButton,“Export HIGHS”,“exports objs”,
[RoutineCall,CheckVersion]
[RoutineCall,CheckSubTool]
[VarSet,activST,[SubToolGetActiveIndex]]//store active subtool
[Loop,[SubToolGetCount],//loop through all subtools
[SubToolSelect,[Val,n]]
//check visibility
[If,([IModGet,“Tool:Subtool 0”]&32 == 32),
//code for visible subtool
[RoutineCall, DoItGRP]
[RoutineCall,DoItExp]
]
,n]//end loop
[SubToolSelect,activST]//reselect active subtool
]//end button