ZBrushCentral

Question, Problems with a Loop

Hello everyone,

I’m new to this from Zbrush and Zscript … I have a question,

How do I to within a macro with loop me ignore Subtools with a specific button activated for example Dynamesh or Dynamic Geometry?

The loop works fine but it applies to all subtools ^^ "

Thank you

Hi :slight_smile:

You can use the [IGet] command to query the state of many interface items. What info you get will depend on the item but for a switch like DynaMesh it will return 1 when it’s on and 0 when it’s off. So you then can use that in an [If… statement like this (as an example, I am masking the whole of a subtool when DynaMesh is off):

[IButton,DoAllSubTools,“Popup info about this button”,

[Loop,[SubToolGetCount],

[SubToolSelect,[Var,n]]

[If,[IExists,Tool:Geometry: Dynamesh],//check there is DynaMesh for this subtool

[If,[IGet,Tool:Geometry:Dynamesh]==1,//if DynaMesh is ON

//do nothing

,//else DynaMesh is OFF

//do something

[IPress,Tool:Masking:Mask All]

]//end if DynaMesh ON

]//end if DynaMesh exists


,n]//end loop

]//end button

HTH,