ZBrushCentral

Zscript keep repeating an if statement

Hey I’m new to Zscript I had a class of JavaScript and there you could check every frame if the if statement was true, now I was wondering if you can do that here. I’m trying to make a size slider that goes from 512 to 1024 to 2048 to 4096.

[ISlider, Size, 512, SizeSliderVal, 512, 4096,] [If, SizeSliderVal>512, [VarSet, SizeSliderVal, SizeSliderVal*2] ]

I’m afraid you can’t set the slider resolution on the fly. The best you can do is something like this:

[ISlider,“Size”,512,512,512,4096
,“Popup info Text”,

[If,([IGet,0]>1024)&&([IGet,0]<2048),
[If,([IGet,0]>1536),

[ISet,0,2048]

,

[ISet,0,1024]

]
]
[If,([IGet,0]>2048)&&([IGet,0]<4096),
[If,([IGet,0]>3072),

[ISet,0,4096]

,

[ISet,0,2048]

]
]

,0,1]

Note that [IGet,0] in the above code is a short way of writing “get the current value of this interface item”.

Thanks man you’re a life saver I will put it in once I continue my script.