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.) :
[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
[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
Thx Marcus. I solved the problem.
Last edited by ZbrushFactory; 10-15-12 at 03:09 AM.
If you don't mind Dragotron , I put one more question in your Thread.
I don't want make a rubbish on the forum.
Marcus maybe you have idea how to check if subtool is zsphere ?
I have idea that I can check this by name, but what will happend when user will change name :/. This complicate all . There is some flag or marker that we can recognize zsphere from others sub tools like, for example, PolyMesh ?
You can test for the different ZTools like this:
Originally Posted by ZbrushFactory
[If,[IExists,Tool:SubTool:Append],//we have a 3D tool
[If,[IExists,Tool:AdaptiveSkin:Make Adaptive Skin],
[Note,"This is a ZSphere"]
,//else there's no Adaptive Skin option
[Note,"This is a Polymesh"]
,//else there's no Geometry SDiv slider
[Note,"This is a Parametric primitive"]
,//else there's no SubTool Append button
[Note,"This is a 2.5D tool"]