Quaternion vs euler

Question(s) at the end. useless backstory in the middle.

Useless Backstory: I’ve been struggling with animation for… ever now. But! I haven’t quit… yet… permanently… yet. I am struggling, at the moment, with rotations. My Blender will rotate my model however it pleases in a quaternion rotation. I know how to work an euler, but I always forget to switch it over to euler before I’m done with all of my keyframes and I go back to check my work. In my experience, switching to euler that late in the process… breaks… everything!!! and I have to start over.

My Question: Can you switch from quaternion to euler without destroying my Keyframes?

Or better: Can someone explain how to control my rotation (clockwise/counter clockwise) with a quaternion?

Update. I hate Quaternions in every way down to the spelling of the word. Why does it exist? More importantly, why is it Blender’s standard. If a Quaternion were a person, I would be arrested just for describing the violent things that I would imagine doing to it before ending its life.

I. Cant. Even. Use. Drivers. With Quaternion. Bones… fml

The main reason to use quatenions is for the interpolation. Quaternions rotate in “straight lines”, regardless of what angle they’re rotating from/to. Like the path of an airplane trying to minimize fuel usage, their rotations describe great circles on a sphere. That’s not true of Euler interpolation.

You can make quaternion drivers, but it’s not straightforward. Mostly, using a driver is going to eliminate the main reason (smooth interpolation) to use a quaternion anyways, so you might as well not. Something with a driver is no longer interpolating (at least, for that driven value)-- it’s deriving the value, every single frame.

It wouldn’t be impossible to convert quaternion animation to Euler animation. I don’t think Blender has the ability to do so natively. But an addon could do it, so you might consider looking around for one.

Quaternions with Ws of n,-n are the same orientation, describing different directions of rotation. Rotation in the viewport should give you shortest rotations, from the sign of W, but you might end up with one that rotates a long path (>180 degrees) at the end, back to pose, when using NLA for example. If you interpolate to a 0,0,0,-1 instead of your 0,0,0,1 rest pose, that can fix some problems. But don’t try to just flip the sign in the sidebar, there’s not enough precision there. (Scaling -1 in graph editor should work to flip a sign.)

The smooth interpolation is why quats are the standard for bones (for objects, Eulers are the standard), which are often used for character animation. Some problems with use are due to Blender’s way of dealing with quats (normalized components). That’s being re-examined by devs, and we can expect some changes in future builds. One thing I hope and expect to see is shortest path interpolation for quaternions.

Hi,

You might want to checkout these links to help enlighten you regarding the use of quaternion rotation vs euler rotations.

This is a cool site which describes them and even has an interactive tool.

This is a bit older but I think it’s quite useful in seeing how quaternion rotation works in Blender.

Cheers and stay safe!

Rigify addon has come with rotation mode converter

rotation mode converter

Please correct me if I’m wrong, but I believe Quaternion rotations can also be understood in a fairy intuitive way. The vector [X, Y, Z] describes the axis of rotation. The scalar W describes how far to rotate around that axis.
Quaternions are certainly a bit more complicated than that, partially because all 4 parameters are normalized as a 4d vector before processing, but I believe this is a fairly accurate and artist-friendly way of interpreting its behavior.

That’s a perfectly accurate description of the third model for transformations, “axis-angle”, the one that nobody uses. But it’s not an accurate description for quaternions. (You can compare axis-angle interpolation to quaternion interpolation if you want to see.)

Ah, okay. I looked at the videos on the Blender Nation link too. It sounds like it’s related, but different.

Still trying to figure out if there’s a good way to manipulate the f-curves on Quaternions, and so far it seems like the best way is to just add more keyframes. Anything else seems to create unintuitive curving.

Yeah, I’d say, not really any good way via the fcurves. Just manipulate the rotations instead, in the 3D viewport.

There is some sense there. A quat is a unit-length, 4D vector. But Blender doesn’t really treat it as unit length. In order to figure out what orientation some arbitrary, poorly formed quat represents, Blender normalizes the vector. What that means is that you can’t really change just one of the channels and expect meaningful results. 0.5,0,0,0 is the exact same quat as 1,0,0,0: the former normalizes into the latter at the time of render (well, a little bit before render.)

There are things you can do. Potentially. If you manipulate two channels in concert, you can get meaningful numerical manipulation of Blender’s quats. But the tools you’d need to do that aren’t really available for fcurve manipulation. The things you want are square roots and polynomials. Not your typical rotate, translate, scale. You’d want to be using drivers.

And, like I said, if you want to use drivers on a quat-- then why even use a quat? The reason to use a quat is for its interpolation, and if you’re using drivers, then you’re telling Blender a specific value to use for every single frame. There is no interpolation on driven channels.

Link to the developer discussion thread in case anyone is interested.

1 Like