ZBrushCentral

New to Zscripting - Looping over all subtools?

Hello,
I am recently picking up zscripting and its a long way off from python thats for sure.

I was curious if anyone could provide a solid example of looping across all subtools and checking how many divisions each subtool has? ( just a print back is fine )

Thank you

Hello @Landon_Ginn and welcome on ZBC,

Here is the code (macro) that loop thought the subtool list and get the maximum value instead of the current value.

[IButton, "???", "Get the number of subdivision levels for each subtools.",

[Loop, [SubToolGetCount],
	[SubToolSelect, n]
	[VarSet, subdLevel, [IGetMax, "Tool:Geometry:SDiv"]]
	[If, subdLevel => 1,
		[Note, [StrMerge,"Subtool-", n, " Does not have any subdivision level\n"],,-1]
		,//else
		[Note, [StrMerge,"Subtool-", n, " has ", subdLevel, " subdivision levels\n"],,-1]
	]

,n]
[Note,] 

,,1]

Hope this helps,
Nicolas

2 Likes