Widget: Modulo Horiz Slider?


I was poking around with the new widgets in the palette and they are lovely.

I was digging around in the horiz slider and, really digging the ‘relative mode’ setting. Now I’m trying to find a crafty way to make it so that it essentially wraps it’s value. As in, once you have moved it all the way to one extreme, a further swipe in that direction wraps the value to the other end of the slider and back towards center.

Does anyone have any tips?



Found it in [widget]/slider0/SliderExt DAT


def ClampMinMax(self, value):
    return max(0, min(value, 1))


def ClampMinMax(self, value):
    return value%1

it would probably be tidier to create a wrapping function definition (ie: ‘ClampWrapped’) and call that instead but, this quick hack solves it.:slight_smile:

Digging these new widgets a ton!