I have a pose bone whose rotation is affected by a Damped Track bone constraint. I would like to determine the exact rotation of that bone (via Python) when it is affected by the constraint.
In other words, I want to:
- Get the posed rotation of the bone in quaternions on a particular frame.
- De-activate or remove the Damped Track bone constraint.
- Put the quaternion rotation values in for that bone, and have it rotated at the exact same angle as it was when the Damped Track bone constraint was active during that frame.
I've found several code examples of how to do this. However, when I implement them, the quaternion values don't turn out correctly. After converting the final matrix back to a quaternion, usually I get quaternions that look like (1,0,0,0), (0,1,0,0), (0,0,1,0), and (0,0,0,1).
I'm using Blender 2.93.1. I'm wondering if perhaps if something has changed in the API with respect to what the matrix values return, so the code examples I've been using are no longer valid. Below are links to some of the approaches I've tried.