or maybe it does i’m just very confused and feel like I’m losing my mind.
I htought I knew how drivers worked, but I recently wanted to built a little example for driver use cases and it blew my brain.
So the X rotation of the switch (blue) is supposed to turn up the emission of the lamp. Thought I could just copy X rotation as a new driver and put it into the emission strength.
BUT the driver reads the VERY CLEAR -45 degree rotation (I later was going to remap it within the driver with +45, so -45 would be 0, whereas +45 would be 90) as -0.785 ??? It also only recognized rotation in world space. When put in Local space, it stay zero, even if I rotate it.
So. Am I going crazy? why isn’t -45 degrees recognized as the value -45 by the driver? Why only in World space and not in local space? It always worked like that with bones, I never had issues like that when I was working within armatures
Internally all the math that involves angles is done using radians. The angles are displayed as degrees in the UI, so that it’s easier to work with.
There are two functions that you can use in your driver to convert to and from the two values.
degrees(radian_value) and radians(degree_value).
radians(-45) = -0.785.
If you want to work with degrees as the result of your driver, you can use degrees(x_rotation) in the Scripted Expression of the driver to do the conversion for you.
You are not really changing the rotation of the switch in local space by just rotating it like that.
If it was parented to something (e.g. an empty), then you would.
Rotating a bone in pose mode is rotating in local space, that’s why Local space works fine in the driver then.
Default angle calculation in drivers is done in radians.
45° expressed in radians: 45 * π / 180 ≈ 0.7854
You, my dude, are a hero. Truly thank you so much. In hinsight I should have seen this coming, this makes a lot of sense.
Thank you for your help, you too @sven2 <3
As a side note the same thing happens in shader nodes and geometry nodes when you use an external value, you can use a math node to convert degrees to radians and radians to degrees.