I’m working on using pydrivers for rigging facial animation, and I think I need a function like so:
maprange(input, input min, input max, output min, output max)
For example, if I run it like so:
maprange(0.5, 0, 1, 0, 2)
then the return value would be 1, but if I run it like so:
maprange(0.5, 0, 1, 1, 0)
the return value would stay the same.
I know what I want the function to do, but I’m terrible at math and just can’t wrap my head around this. Any help would be greatly appreciated, and sorry if this has been brought up before, but I didn’t see it when I searched (could have used the wrong words) and I didn’t see it in Blender.Mathutils.