//ZScript changes for 4R8 [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,DoIt,//start of routine //put code here for whatever you want to do [Note,"TEST"] //this note just to show - remove ]//end of routine [IButton,"Get All Vis","Check Visibility of All subtools", [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 [Note,[StrMerge,"SubTool #",[Val,n]," is VISIBLE"],,1] , //code for invisible subtool [Note,[StrMerge,"SubTool #",[Val,n]," is HIDDEN"],,1] ] ,n]//end loop [SubToolSelect,activST]//reselect active subtool ]//end button [IButton,"Do Visible","Run routine on Visible subtools", [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,DoIt] ] ,n]//end loop [SubToolSelect,activST]//reselect active subtool ]//end button [IButton,"Get Selected Vis","Check Visibility of Selected subtool", [RoutineCall,CheckVersion] [RoutineCall,CheckSubTool] [VarSet,activST,[SubToolGetActiveIndex]] [ISet,Tool:Sub Tool:SubTool ScrollBar,0,([SubToolGetCount]-(activST+1))] [If,([IModGet,"Tool:Subtool 0"]&32 == 32), [Note,"Selected subtool is VISIBLE",,1] , [Note,"Selected subtool is HIDDEN",,1] ] ]//end button [IButton,"Get Selected SubTool All Mods","Check Icon status of Selected subtool", [RoutineCall,CheckVersion] [RoutineCall,CheckSubTool] [VarSet,activST,[SubToolGetActiveIndex]] //positions scrollbar so subtool at top of list [ISet,Tool:Sub Tool:SubTool ScrollBar,0,([SubToolGetCount]-(activST+1))] //check the mods [If,([IModGet,"Tool:Subtool 0"]&32 == 32), [Note,"Is visible\n",,-1] ] [If,([IModGet,"Tool:Subtool 0"]&16 == 16), [Note,"Polypaint on\n",,-1] ] [If,([IModGet,"Tool:Subtool 0"]&1 == 1), [Note,"START\n",,-1] ] [If,([IModGet,"Tool:Subtool 0"]&2 == 2), [Note,"Addition\n",,-1] ] [If,([IModGet,"Tool:Subtool 0"]&4 == 4), [Note,"Subtraction\n",,-1] ] [If,([IModGet,"Tool:Subtool 0"]&8 == 8), [Note,"Intersection\n",,-1] ] [Note," "]//display result ]//end button //The "Action Is not Undoable" warning note can now be dismissed by ZScript //by using [IKeyPress,'1',...] to select the first option, //[IKeyPress,'2',...] for select the 2nd option, etc. //***Note that the ' ' is required. //Example for deleting a subtool: [IButton,"Delete Subtool","Delete selected subtool - without warning!", [RoutineCall,CheckVersion] [RoutineCall,CheckSubTool] //IKeyPress of 2 will select the second option of the dialog popup. [IKeyPress,'2',[IPress,Tool:SubTool:Delete]] ]//end button