AM_ShoulderConstraint Update

I have been working the past couple evenings on another Maya plugin, a hip constraint. It is finished, but the setup tools are not yet ready for it, so expect it probably by this weekend! While working on, however, I discovered a couple bugs in my shoulder constraint node, so I have uploaded an updated version of that (1.1). The update is not a big deal and the chances of it affecting anyone are very slim, but I did primarily two things.

First, I now cast the incoming enum for rotateOrder as short instead of as int, as there is a known problem in Maya Python accepting pointers to integer as reference to enums. For whatever reason it did not appear to cause a problem in my plugin, but I would rather be safe than sorry.

Second, I slightly adjusted the math for building the final quaternion. Though I never actually saw a problem with it, there was the possibility of building a weird rotation if the shoulder’s pretransformed up vector was exactly 180 degrees from the world-space target up vector (i.e. there are infinite different possible quaternions to build the rotation from one to the other). The problem can still happen only if the pretransformed up vector is exactly 180 degrees from the world-space target up vector and the shoulder’s transformed (world-space) up vector is exactly 180 degrees from the target up vector. Because the chances of this happening in a human range of motion are infinitely small, and the chances of this configuration of vectors is infinitely small, I didn’t bother to devise a more elegant solution. However, please do let me know if any of you have a different suggestion of how to address it!

Tags: , , ,

Leave a Reply