Why are quaternion's default?

Why is quaternion the default rotation mode for armature bones?
Do gooseberry animators use it by default?
Why is there no way to set a default rotation mode in bender?

Anything Euler is going to be prone to what they call Gimbal Lock in some instances (you generally need some tricks otherwise to avoid it).

That type of situation is already present with the industry standard ‘turntable’ mode that is default for Blender scene viewing (rather difficult to maneuver it past certain orientations).

Its easier to deal with gimbal locks than to animate a character in quaternion. You didnt answer the question about blender foundation project animators using quaternion on their character animation. :slight_smile:

So are they using quaternion or euler? Whats most common over there?

I don’t know with Gooseberry, but Nathan Vegdahl, who rigged several of the prior Open Movies, uses a combination of quaternion and euler. Ball joint, such as shoulder = quaternion; hinge joint such as an elbow = euler. I think he has a whole section about it on Humane Rigging, but I haven’t watched it in awhile so might be mistaken.

1 Like

Ball and socket joint = quaternion

Joint with two axes of freedom = Euler with the two moving axes at each end of the rotation order, e.g. for X and Y rotation use XZY order, and lock the unused (middle) axis

Hinge = Euler with two unused axes locked

Why’s quaternion default tho? Couldn’t say.

2 Likes

there is one magazine talking about all these rotation things for animation / rigging
check it out
but not an easy subject to follow and understand it !

one of the major problem as mentioned before is the gimbal lock
but also the questions of object parent children ect…

but even with quaternion rot angle must be less then 360 degrees
you will find this in the magazine description.

happy bl

what’s this magazine called? I’d be interested :smiley:

but yeah honestly animating with euler rotations is way easier as soon as you want to polish the fcurves.

gimbal lock can actually be easily avoided by setting the correct rotation orders or for example by adding an extra bone that is used to handle orientation.

my personal preference yould be euler as standard because that’s what 90% of my bones tend to be

check mag 31

happy bl

That is very interesting advice. Stored.

I suppose quaternion is default because it has simply been so for so long no one bothered to change it, I think there is a easy enough workaround with the key-map, where one can change the property of the bone to be default=euler, or something like that, I’ll have my computer tomorrow and post a way to do this.

I realize it’s been four years since you posted (are you the same user as @proxe ?), but are you aware of a way with the key map to make each new extruded bone in an armature use the XYZ Euler rotation mode by default?

(I know the rationale for quaternions and I’m aware of the potential for gimbal lock with Euler rotations. Despite that, I want Euler XYZ as my default bone rotation when using Blender. I just don’t know how to do it.)

Sorry, I totally forgot to reply to this thread, but there isn’t anything within extrusion keymap that allows the adjustment of the rotation_mode, this property seems to be defaulted to Quaternion, so when the bone is created it would use that default.

A custom extrusion operator wrapper could be made.

Could you point me in the right direction with how to go about doing this? I have no problem coding something myself, but I’m not sure where to start with writing a custom operator wrapper.

Mathematically, quats can be expressed as eulers and vice-versa. The algorithms are easy to find. The trick will be getting the Python code just right that fits it into the user interface. Quite a lot of work ahead of you – hope that you decide it was really worth doing.

(Clarification: “any position of a quat can be expressed in euler terms and vice-versa.” The important mathematical differences appear when you begin to combine transformations, as Blender constantly does.)

Mathematically, quats can be expressed as eulers and vice-versa. The algorithms are easy to find. The trick will be getting the Python code just right that fits it into the user interface. Quite a lot of work ahead of you – hope that you decide it was really worth doing.

@sundialsvc4 – thanks for the response, but I’m not sure if you’ve misunderstood my question or if you’re describing the actual answer and I’m just not grasping it.

I’ve written code to convert quaternions to Euler and vice versa; that’s not a problem. But the issue I have in Blender is, every new bone that I add to an armature has a quaternion rotation mode by default. I have to manually change every new bone to XYZ/XZY/YXZ/etc. Euler, which is annoying.

I would rather have it so that any new bone that gets extruded in an armature is set to XYZ Euler. Later on, as I’m refining the rig, I can decide whether it makes sense to set it to one of the other Euler rotation modes (to prevent potential gimbal lock). So I may not always end up with XYZ Euler as my rotation mode on a bone, but I know for a fact that I absolutely, positively don’t want to use quaternion. (As an animator, it’s easier to think in terms of Euler than quaternion, especially when it comes to adjusting curves in the Graph Editor.)

@proxe said this:

A custom extrusion operator wrapper could be made.

I develop software, and I get the concept of a wrapper, but I have no idea where to start with making a custom extrusion operator for an armature. I’m looking for any sort of hint as to what I need to write.

Even if someone can point me in the direction of some other custom operator wrapper and show me how it’s done, that would be helpful in giving me an idea on how to do this for extruding bones. I’ve skimmed through (some of) the Python code included with the Blender installation in the hopes of finding out how to do this, but have been unable to figure it out so far.

Use the Info window while doing what you want to do by hand. It will show you most of the Python you need to do. That should get you started.

Use the Info window while doing what you want to do by hand. It will show you most of the Python you need to do. That should get you started.

I already use the Info window when figuring out how to script things with Blender, but how would this help me extrude bones that default to something other than a quaternion rotation mode?

For example, when I extrude a bone, I get this in the Info window:

bpy.ops.armature.extrude_move(ARMATURE_OT_extrude={"forked":False}, TRANSFORM_OT_translate={"value":(-0.127691, 0.17918, -0), "orient_type":'GLOBAL', "orient_matrix":((1, 0, 0), (0, 1, 0), (0, 0, 1)), "orient_matrix_type":'GLOBAL', "constraint_axis":(False, False, False), "mirror":True, "use_proportional_edit":False, "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "use_proportional_connected":False, "use_proportional_projected":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "cursor_transform":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False, "use_accurate":False})

I don’t see how this helps address the issue. I’m not looking to create bones via script; I’m looking to intercept the way that Blender works so that any new bones that I create through the UI have a default rotation mode of XYZ Euler.

I still don’t have any idea as to how to intercept Blender’s default behavior via Python script. (I know I can fix this issue if I make a personal fork of Blender’s code base – which I’ve done before – but I’m trying to avoid that going forward and rely only on the official releases.)

You’re overthinking it. You won’t be able to do any kind of “intercepting” of the behavior, you’ll have to make your own tool to do the same thing + the things you want.

1 Like

You’re overthinking it. You won’t be able to do any kind of “intercepting” of the behavior, you’ll have to make your own tool to do the same thing + the things you want.

Is that what was meant by a “custom extrusion operator wrapper”?

If so, it’s probably just easier to fork Blender’s source code again :confused:

By ‘operator wrapper’, I’m assuming it just means making your own operator which calls bpy.ops.armature.extrude_move('INVOKE_DEFAULT') within it’s execute function.
And then get a reference to that new bone and set it up however you like.

Although getting a reference to the new bone may be challenging, calling extrude_move will only return whether the operator was successful or not, not the bone itself.