Confused with rotation animation

I tried searching for this topic but couldn’t find anything useful. Scratching my head here trying to animate a couple of screws which should be something trivial but it isn’t for some reason.

Ok, so I had a couple of different (model-wise) screws. They’re both at a random angel to the world. Both of them have correct origin points. Both origin points show local Z being the correct axis for rotation. Yet only one screw behaved like it should, the other one was rotating like a crazy gyroscope. What’s even more confusing is that it showed Y-axis changing the value though I was rotating it along Z ( R-Z-Z). The same thing (Y-axis changing it’s value instead of Z) is true about the other screw, though the animation looks normal.

I tried a couple of things. Switched to quaternion and it refused to rotate at all. Finally I somehow managed to fix this issue by switching to ZYX Euler instead of XYZ and had to reposition both the model and the axis (I think. I’m not sure what I did exactly as at this point I was doing random things hoping this stress will go away) and it works now like it should. But I’m still confused and hope someone patient enough can explain this anomaly.

[edit] Now that I look at the supposedly normal first screw with origin axis turned on, Z axis is slightly wiggling. I just don’t get it. How are you supposed to animate on a local axis with a predictable result? Is there another hidden origin point that screws things up? Why is it showing that the object is rotating along Y-axis if it’s clearly rotating along Z-axis?

Blender nerds, correct me, but I think you can’t animate on local axis, when you animate, only global axis are taken into account, so if your object is not aligned with the global axis, it may give bad results because you completely depend on how the interpolation will happen between keyframe 1 and 2.

The best thing to do, if you’re animating objects, and not bones, is to align them back with the global axis, parent to an empty, rotate the empty so that your object is oriented the way you want in the global axis, animate the child object. Now, as the object is parented, its new “world” orientation reference is the empty, so it will rotate correctly however the empty is oriented in the 3D scene.


Thanks for your answer. Not quite what I was hoping to hear, but I’m starting to understand the cause of my troubles at least partly. Yet this feels wrong on so many levels. Doubling object count with empties for something as trivial as one axis rotation is just wrong. :confused:

Other axes’ values changing with rotation is because of aliasing: the fact that there are more Euler triplets than there are angles. (Rotating 180, 0, 0 is the same as rotating 0, 180, 180.) Blender uses a formula to convert equivalent Euler angles into the same values. This can easily be a problem-- the above angles are the same, but the interpolation to get there is different. You can specify specific values by making edits in the graph editor, or by entering numbers in the rotation field manually and keyframing. But just increasing the value of Z rotation isn’t going to do what you expect…

If you’re mainly going to be rotating your screws in their Z axis, you probably don’t want default transformation mode, which is XYZ Euler for objects. That’s because this mode of calculating Z last leaves it dependent on X and Y. That makes gimbal lock likely and increases risks of wonky rotation through Z (since more of your Z axis rotation will show up on other axes.) You want Z figured first, or else you want quaternion or axis angle rotation. (Or else you want to change the object so that its primary axis is its X axis.)

I don’t know why quaternion mode doesn’t work on your object. I’d suspect a locked W channel. But I’d have to see a file. Myself, I like quaternions, which is good, since I like bones and bones are quaternions by default. (You might try using bones, even if nothing is getting armature deformed. They simplify all these transformations.)

Note that regardless of transformation mode, rotating an object in a single local axis is always safe. It is only when you combine rotation in multiple Euler axes that you run into these troubles. But then, how can you have a screw at an angle relative to your world, without rotating in X and Y? By parenting it to something else, and rotating that parent in X and Y.

Otherwise, yeah, objects actually interpolate, keyframe, rotate using local axes, not global. I guess that makes me a Blender nerd :slight_smile:

1 Like

Thanks for your detailed reply, bandages. Like I mentioned earlier, I figured that I needed to change XYZ to Z being the first. It’s just that I never encountered this exact situation before. So I got confused a bit. I just don’t want to resort to empties and looking for a more elegant solution.

Not sure why. I didn’t lock anything. I insert Rot key, go few frames forward, rotate on Z axis, insert another key, play the animation and screw isn’t moving (or rotates just a tiny bit during some experiments). The exact same thing happens with ZYX Euler. I can manually type 720 degrees in Z axis and insert a key and it works. With quaternion however I couldn’t use this workaround as it changes all 4 parameters when I rotate on Z axis and I just have no clue what numbers to put.

It’s fine that it changes on all 4 parameters when rotating in quaternion. Quaternions don’t work the same way as Eulers do. Set pivot point, set orientation to local, r z 120 enter (for example) to rotate it 120 degrees in the Z axis.

Except, be aware that you can’t use quaternion transforms to do rotations >180 degrees, and 180 degrees exactly is ambiguous. Quaternions are shortest path rotations, and 720 degrees of rotation is the same orientation as no rotation (2 full circles), so the shortest path between those is no rotation. That may explain why you weren’t seeing any rotation.

1 Like

Ok, finally I understand it a bit better and have an idea how to proceed. Thank you both for your time. Not sure which post to mark as a solution - they’re all enlightening.

oh my bad, I always thought, because of all these interpolation problems, that Blender used the global axis, anyway I think parenting to an empty is often the safest way to fix these problems (and avoid headaches)

There are just so many little hidden things (like I didn’t even get into parenting inverses, and how unparent keep transform keeps them, and deltas), and then you add onto that that Eulers seem so deceptively intuitive, and for me, yeah, I’m exactly the same way, if orientations are important, I don’t do object transforms. I use bones, which is basically just, use more parents. (I mean, there are exceptions, I don’t build a bone to track every single rigid body.)

Bone transforms, and quaternion rotation, just makes it all so much simpler in my mind. Quaternion bones do exactly what I expect them to. (Provided I didn’t use any constraints that end up evaluating their quaternions as Eulers anyways…)

Bandages is right, use parents. One empty for each screw, position/animate them using the empty, but leave the Z rotation to the screw object itself. Or you could use delta rotation instead, it’s just an additional transform channel on top of your object than you can use for positioning, and it won’t affect the screw’s own matrix, just like parenting does. It’s just a little bit more inconvenient to use in my opinion, as it doesn’t show up in the sidebar, but it’s conceptually the same.

I chose to change euler method instead. Empties make the scene look like an urchin and complicate the navigation in the outliner, considering that I already have other objects as parents and they have their parents as well. I tend to copy small details, snap them onto the surface, animate them occasionally and it’s hard to remember that I also need to unhide empties, select them both, duplicate, then move and snap the empty instead of the actual object, etc… :expressionless:

1 Like

“Is there another hidden origin point that screws things up?”
Great pun. :smile:

My head is spinning :crazy_face: thinking about it all, but just wanted to suggest providing the blend file next time (just the necessary parts if you don’t want to share all of it), so we can see first hand what the problem is.
Hope you got it all sorted out. :wink:

1 Like