Rotation by driver is too fast

Hi guys. I have 2 objects: a circle (SpotCTRL) with a property created by me named “HastRot”, and a cylinder (SpotHaste). I´ve “connected” these two objects using driver (SpotCTRL property HastRot controlling the Z Rotation of the cylinder). The range inside “HastRot” field is from 0 to 360. It´s working, but the relationship between the two fields (HastRot and ZRotation) is not 1:1. For example, HastRot = 1 => more than a turn in ZRotation.

I think this is happening because the calculation is in radians. How can I convert this to degrees?

Thanks in advance.

Drivers always work in Radians, there are 2 * pi radians in a full circle, so to work in degrees, you must multiply radians by 180 and divide by pi. From what you have said,I suspect this is not the problem, so post a simple blend file please for me to look at.

Cheers, Clock. :beers:

Hi Clockmender. I´ve solved the problem editing the Driver curve, in Graph Editor, but it´s not accurated.
I have attached the blend file.

Thanks.

light.blend (4.9 MB)

No you didn’t solve the problem! You actually made it worse… So here is the theory:

All rotational drivers are in Radians, not degrees, so you must feed it Radians, not degrees.

The custom property has degrees in the value, so you must convert this to Radians in the driver.

To convert degrees to Radians, you multiply by pi and divide by 180.

So your driver must be a “Scripted Expression”, not “Averaged Value”. The driver value therefore is:

var * (pi / 180)

Where var is the value from your custom property, like so:

You must check “Autorun Python Scripts” in User Prefs => File Tab for scripted drivers to work:

And then save user settings.

Cheers, Clock. :beers:

EDIT:

Modified Blend file: light-clock…blend (4.9 MB)

Thanks a lot, man! Great explanation.

1 Like