ZBrushCentral

ZScript Question - Getting Subdivision Count and Determining If Dynamic Subdivisions is Enabled

Hello,

For ZScripting, how can I retrieve Subdivision Count and Determining If Dynamic Subdivisions is Enabled, from an actively selected ZTool

I had to find a few zscript commands that were not found in the ZScript docs, could you point me to a list of all ZScript commands, an API doc of sorts?

Thank you,
chrisp

Hello chrisp,

Welcome to ZBC. :slight_smile:

You can get the SubDivision Count like this:

[If,[IExists,Tool:Geometry:SDiv],
	[If,[IsEnabled,Tool:Geometry:SDiv],
		[VarSet,maxSDiv,[IGetMax,Tool:Geometry:SDiv]]
		[Note,[StrMerge,"There are ",maxSDiv," SubDivision levels"]]
	,//else not enabled so no subdivs
		[Note,"There are no SubDivision levels"]
	]
]

And the state of the Dynamic Subdiv button like this:

[If,[IExists,Tool:Geometry:s.Dynamic],
	[If,[IGet,Tool:Geometry:s.Dynamic],//Dynamic Subdiv is on
		[Note,"Dynamic Subdivision is ON"]
	,//else it's off
		[Note,"Dynamic Subdivision is OFF"]
	]
]	

For the ZScript commands, the online reference is here and up-to-date:
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/

HTH,
Marcus

1 Like

This is fantastic - Thank you very much for your help, Marcus!

1 Like