ZbrushFactory,
You can do it like this. Note that [IModSet] is not always reliable; it is best to test the Mod and then simply click on the subtool to make it visible/invisible.
This example runs through all the subtools and turns them off if necessary. (Note there is no error checking to see if a polymesh is selected, if there is more than one subtool, etc.) :
Code:[IButton,TurnOffAllSubTools,"Loop through all subtools and turn them off", //this avoids an error if the top subtool is selected & hidden [If,[SubToolGetActiveIndex]==0,//if the top subtool is selected [SubToolSelect,1]//select the second subtool ] //loop through all subtools [Loop,[SubToolGetCount], [SubToolSelect,[Val,n]]//select the subtool by number [VarSet,subToolPath,[IGetTitle,Tool:Item Info]]//get subtool name [VarSet,subToolPath,[StrExtract,subToolPath,0,[StrLength,subToolPath]-2]]//trim off period [VarSet,subToolPath,[StrMerge,"Tool:Sub Tool:",subToolPath]]//set the path [If,([IModGet,#subToolPath]>=17),//check the mod [IClick,#subToolPath]//click to turn it off ] ,n]//end loop ]


Pixologic ZBrush Blog


















Reply With Quote
