get coordinates of bone from the perspective of second bone in driver I'd like to get the coordinates of one bone from the perspective of an other bone, i.e. figure out the x,y,z coordinates of bone A where the axis of the space is aligned with the rotation and location of bone B. The purpose of this is to drive different shape keys for when a bone is moved forwards or side wards relative to some other bone. It sounds like something like this ought to be possible in blender but so far i can not come up with a way of doing it.

If there happens to be some other elegant solution to the intended end-goal i'd be happy to take that one too.
Although not in the same direction as i was originally thinking, one can get a good sense of which direction a bone is at using the following construction:

create a helper bone parented to and aligned with bone A, with a damped track constraint pointing to bone B. Now add the driver using the desired rotation of the helper bone  (e.g., X, Z) in swing and Y twist mode within local space. In this mode the angle is calculated as if the bone was first swung in the X,Z axis to align the bone, and then twisted in Y to match up the axis. This thus gives us an indication of the direction of bone B from the perspective of bone A without having to worry about any twisting around the Y axis of our helper bone.