Slider Widget - limit range

hello,

Maybe a very dumb question with simple answer :

I am using a slider widget which value is a float between 0 and 1.
I would like to limit this value to 0.3 to 0.5 for the entire range of the slider.

Maybe i am blind but i can’t seem find any parameter in the widget for this purpose.

Is there a way to achieve this other than “hacking” the slider widget network ?

Thanks a lot

I think the only option now is to RMB the widget and select ‘Customize component’, and set the clamp values of the Value0 parameter.

customize.png
according to this post by Jarrett the next advanced widgets editon will have more streamlined approach for this

hey !

that seems great for now. Much better than what i was considering on the component network side :slight_smile:

thanks a lot

You could also use the tdu.remap() function to map the slider from 0-1 to .3-.5

Here’s a link to a tox that shows how to remap
1drv.ms/u/s!AveCMDOyRMU1gZlHo6bsv8Qo_L5BOg

hi,

Good to know ! Thanks a lot !
It seems to act like the math chop but doesn’t work for my purpose as i need the widget value to display the remapped values

But this is a good thing to know for the future :slight_smile:

@nettoyeur is this still the best answer 2 years later? It won’t let me enter an expression here. I want to drive this range from the result of another operator.

By the way, is it possible to make the slider only display integer values? I tried changing the field type to integer but that didn’t do anything. It still shows decimal places as I drag it.

Okay I figured it out, I have to set the Integer type in the Component Editor dialog. I’m not sure what is the purpose of the field type under the widget field page, it doesn’t seem to do anything.

The Field Type parameter only affects the text input into the field, when set to Integer you can not add decimals or fractional numbers into the field. It does not effect grabbing the slider handle and moving that or changing the value parameter directly.

1 Like