Need help with using matrix constraint techniques along with joint orients


Okay, what I am trying to do is very basic actually. I have two joint hierarchies, one being an exact duplicate of the other. Both hierarchies include two joint chains. One chain on the positive X and one on the negative x (mirrored). Now I want to use matrix constraints to lock the relevant joints to the duplicated one, no matter what. In case you don’t know what I mean with matrix constraints, please check out this link:

Basically everything works fine, except for the mirrored side of my joint hierarchies. A behavior mirrored joint chain adds a value of 180 to the first joint’s X orient attribute. It seems like these orient values also contribute to the world matrix output which leads to a double transformation with my current setup for the rotation channels. I created a little demo scene to outline the issue. You can download it here:

In this file you can find the two joint hierarchies and a red squared controller. On the controller you will find a “blend constraint” attribute which will blend between the constrained state and the default state. When you display the local rotation axis, you will notice that once the blend value is set to 1, the rotation axis don’t line up, at least for the mirrored side. The joint chain without orient values will behave like expected.

I am sure there is a simple way of solving this issue, but I guess I just don’t know enough about matrices and how to calculate with them in order to solve it on my own. If any of you can point me into the right direction I would be very grateful!