Thanks, Cambo. That helps.
I guess I should try to clarify my statements about bone roll, since I carry on about the matter so much.
If you create a one-bone armature, then turn on “Draw Axes”, the bone’s y (twist) axis should be pointing “up” relative to the camera view in which it was created. The z axis pointer should point forward. Don’t alter the bone’s roll settings at this point. If you then grab the bone’s tail and start dragging it around, the drawn axes shift around as the bone’s y axis direction changes. The direction in which the axes point (specifically “z”, since that seems to be the point of reference when “correcting” bone roll to be sure that things point the right way) is the information I’m after. I’ve been calling this the “intrinsic roll” of the bone. It results from setting head and tail positions, and the “bone roll” which we set via Blender interface or Python seems to compensate for this value. I’ve read of vectors having a “roll” characteristic, and I assume the “intrinsic roll”, then, might be the roll of the bone as vector. I think I’ve seen this information in a bone’s bonespace matrix (expressed as euler), but the values I’ve seen also seem oddly inconsistent sometimes.
So “intrinsic roll” is the variance in roll axis direction (relative to the worldspace, I assume - or maybe the armaturespace?) which results from the relationship between head and tail. “Settable roll” is the roll value that we set to compensate for intrinsic roll, to make the armature’s bone rotation orders consistent. Intrinsic roll is visible when settable roll is zeroed and the axes are drawn. That’s how I’ve been thinking about it. Intrinsic roll is in the rest matrix somewhere, but it keeps hiding from me. All of this relates to what they call “rotation order” in Poser-land.
I’m trying to work with this in a couple of ways (and failing, thus far, unfortunately). When flipping or symmetrizing an armature’s pose across x, it becomes important that each bone and its symmetrical counterpart have their bone roll axes pointing in the same direction - or have these directions corresponding in a way which will create a symmetrical flip. But I’ve seen at least one armature which has the axes pointing all over the place on the legs when bone roll (the type we can set) is zeroed. To symmetrize a pose for such an armature I either need to be able to compare the roll axis directions for the two symmetrical bones and compensate or I need to correct the settable bone roll setup for the armature. (Or find a way to remove bone roll from the equation altogether, as your .bvh code allows for poses in general; the same process hasn’t worked for symmetrizing.)
So I’m trying to find a way to compensate for or automatically alter and correct bone roll asymmetry in otherwise symmetrically-structured armatures. I assume I could find this “intrinsic roll” and use it to find either the corrected settable bone roll for the armature or to create symmetrical pose settings when roll directions are incompatible.
So maybe I’m asking the wrong question. Perhaps I should ask how to work with a rest matrix to overcome or fix bone roll issues. Hmm. Am I “barking up the wrong tree”? Woof.
Still all muddled and obscure, right? Sorry. Anyway, I’m working on it, and I think your post helps. Thanks, Cambo.