Instead of "Subtool 0" I'd like to have the name I gave the subtool. (ie, head, hand, arm, etc.) I assume I need to look up the name of the subtool and insert that name where "Subtool 0" currently is. I can't figure out how to look up the assigned name.
Ultimately I'm trying to create a script that will go through each subtool and check if visibility and polypaint is on or off.
You can use [IGetTitle] to get the subtool name then use [StrMerge] to create the subtool path. See here:
[CODE][VarDef,subTName,""]//defines variable as empty string
[VarDef,subTool(1024),0]//defines a list variable to hold visibility (0 = off, on = 1)
[VarSet,totalSubTools,[SubToolGetCount]]//the total number of subtools
[VarSet,activeSubT,[SubToolGetActiveIndex]]//record the active subtool
[If,activeSubT==0,[SubToolSelect,1]]//this stops an error if the top subtool is selected but hidden in the list
[SubToolSelect,[Val,n]]//selects the subtool by number
[VarSet,subTName,[IGetTitle,Tool:ItemInfo]]//gets the tool name
[VarSet,subTName,[StrExtract,subTName,0,[StrLength,subTName]-2]]//trims off period at the end
[SubToolSelect,activeSubT]//return to the active subtool[/CODE]
Note: this example uses commands introduced in ZBrush 4R4 and not available in earlier versions.