Scripted expressions editor gives unexpected results Does anyone know why when I type in driver editor / scripted expression I get funny values?
This is my examle:
I drive spotlight angle with an cubes translate Z value witch is limited to value between 5 and 8(limit location constraint).
So when I leave &quot;var&quot; alone (which is 5 value) the result is 180° instead of 5?
Does anyone knwo why and how to remap the range from 5-8 to be 1-180?
Thanks in advance!
I answered my self when I posted this question :D
The scripted expression is working in radians by default and is auto converted to degrees in the spotlight object. So what I did was: var - 5 and got my range just in the sweetspot.
Now it goes approximately from 1 to 172 deg.
I'm not sure for the precise math behind it, but it is working for me. If you need in depth how the math is functioning, check degrees to radians conversion.
Cheers!