ZBrushCentral

Is there a MOD in ZBrush scripts?

hey guys ,

how to use MOD function in zbrush scripts?

like c and c++ or python 8%3=2 9%3=0
when i use “%” in zbrush scripts ,it cant be used.
it very bother me long time.

i need help…

Yes, the only Math functions directly available in ZScript are the ones in the Command Reference:
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/#MathFunctions

So you’ll have to calculate the value for MOD, such as:

[RoutineDef,GetMod,
[VarSet,mod,arg1-(INT(arg1/arg2)*arg2)]
,arg1,arg2,mod]

[IButton,GetResult,“Do it”,
[VarDef,modValue,0]
[RoutineCall,GetMod,17,3,modValue]
[Note,modValue]
]

thanks very much!!