[VarDef,totalSubTools,0] [VarDef,subToolPath,""] [RoutineDef,DoIt,//start of routine //put code here for whatever you want to do [Note,"Visible",,1] //this note just to show - remove ]//end of routine //ZBRUSH MACRO [IButton,???,"Do for all Visible SubTools", [IShowActions,0] [IConfig,4] [If,[IExists,Tool:SubTool:SelectDown],//this makes sure that we've a 3D model selected [VarSet,totalSubTools,[StrExtract,[IGetTitle,Preferences:Misc:SubTools Count],10,256]] //go to top of subtool list [ISet,Tool:Sub Tool:SubTool ScrollBar,0,(totalSubTools-1)] [IPress,Tool:Sub Tool 0] [Loop,totalSubTools, [VarSet,isVis,0] [If,pos < 8, [VarSet,subToolPath,[StrMerge,"Tool:Sub Tool ",[Val,pos]]] , [VarSet,subToolPath,"Tool:Sub Tool 7"] ] [If,[IModGet,#subToolPath]>=16,//if the subtool is visible [RoutineCall,DoIt] //call the routine for what we want to do ] [If,[IsEnabled,Tool:SubTool:SelectDown], [IPress, Tool:SubTool:SelectDown] ,//else no select down so end of subtools & exit [LoopExit] ]//end if ,pos]//end loop //go to top of subtool list [ISet,Tool:Sub Tool:SubTool ScrollBar,0,(totalSubTools-1)] [IPress,Tool:Sub Tool 0] ] ]//end of macro button