I'm struggling a bit.
I have an arm rig which is in pose mode. The arm is a chain with four bones with an ik constraint, connected to a shoulder which is outside the ik chain:
* shoulder (unaffected by IK)
* upper arm 1 (last bone in IK chain)
* upper arm 2
* lower arm 1
* lower arm 2 (has IK constraint)
Now I want to know the rotation of "upper arm 1" relative to its rest position, in *local* space. That is, disregarding its parent's rotation and disregaring the whole armature's rotation. If the ik chain hasn't shifted the bone at all from its rest position, this should be (0, 0, 0) XYZ rotation.
Looking at https://docs.blender.org/api/current/bp ... eBone.html I have tried the following:
* rotation_euler / rotation_quaternion: These don't work since they are *before* constraints/modifiers and I want the rotation *after* constraints/modifier
* matrix.to_euler() / matrix.to_quaternion(): This sounds as what I want, but the matrix is in object space, not local space. Maybe there is a clever way to convert it to local space?
So question: how do I find a pose bone's rotation relative to its rest position in local space, including the effect of any modifier/constraint?