updating run on all subtools zscript to 4r8

I need help!

None of the zscripts that I have written that run commands on all visible subtools seem to work anymore with zbrush 4r8. I’m not sure what all has changed on the zscript side with 4r8 and I’ve been banging my head against my desk trying to sort it out.

I don’t get any errors in zbrush when I load the script or when it runs. It will even spit out my print command at the end of the script telling me that everything ran. It’s as if it is running, yet no commands are executed.

Here is the sample code that I am tweaking to do what I need. I got it off of these forums awhile ago. I know there are a few different ways to do this so if there’s a better way please let me know. Thanks!


[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,???,“Do for all Visible SubTools”,
[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]
[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



[IPress, Tool:SubTool:SelectDown]

,//else no select down so end of subtools & exit


]//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

Hi Eric,

I’ve just posted a new thread with the changes needed for 4R8:

Let me know if you’ve any questions!


Absolutely perfect Marcus! Exactly what I needed!