2
$\begingroup$

I'm trying to create a custom property to control a bone's rotation.
I need a value between a min and a max **degree** value (in my case min -50 and max 20). I tried writing that in multiple ways, but I am struggling. Inputting -50 and 20 alone gives me figures of -1245 degrees for my bone rotation. I went and tried to divide them by 360 and by pi (separately) which didn't help either. And well the most obvious way of adding a "°" or "d" did give me a syntax error.
I also stumbled across this unanswered question on reddit which is basically asking the same. https://www.reddit.com/r/blender/comments/eakun5/how_to_input_degrees_in_driver_menu/


So... Is the to-go good old maths formula to convert that number into a degrees one? What am I even inputting right now? Radiants? I know not one thing about them other than their existance.

Hope somebody can help me clear the confusion. Thanks in advance!

$\endgroup$

1 Answer 1

5
$\begingroup$

When you create a custom property, you don't specify a unit type. So it's not radians, and it's not degrees. It's just a number.

The whole confusion with degrees vs radians is that Blender uses radians internally, but for many fields (like Euler rotations) expects an input in degrees (which it then converts to radians internally).

So if you want to use this custom property in your driver, convert it from degrees to radians by using the radians function like so: radians(var).

List of fast driver tokens

List of safe (sandbox) Python

$\endgroup$
2
  • $\begingroup$ Thanks for the clarification. I found a way via using a page that lets you calculate the degrees/radians counterparts. It helped me set the value, but I'll keep this in mind for the future. $\endgroup$ Commented Jan 30, 2023 at 20:31
  • $\begingroup$ @xDonnervogelx a thing to remember is that $\tau$ rad = $360°$. In python degrees(tau) == 360. $$\tau = 2\pi$$ $${\tau\over 360} = 0.017453292519943295…$$ $${360\over \tau} = 57.2957795130823…$$ Those are the numbers by which you multiply/divide a number to express the same angle when using the other unit. Or in other words, 1 rad ≅ 57°, and 1° ≅ 0.017 rad. $\endgroup$ Commented Jan 30, 2023 at 22:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .