View Full Version : Procedural Rig in Maya question??

04 April 2003, 08:34 PM

Im building a procedural rig in Maya and Ive got a small problem with pivots. I managed to solve it, but it just seems like a really difficult way, so Im just checking if there is an easier way.

So here goes:

I have a node that I want to be snapped to my wrist and then I want its pivot to be snapped to the elbow. The problem is that the translate co-ordinates for the elbow joint are based on their creation, so they are like 0 0 15, but in world space they are actually like 30 12 6. This has to be done via a script, so I cant just go into pivot mode and snap to the elbow. I need to actually assign the position of the elbow to the rotatePivot values of the node. When I point constraint my node to the wrist, the rotatePivot values are still 0 0 0, so now if I want to get it to the elbow, I dont have anyway of doing this. Thats basically my problem.

Here is how I solved it:

I create a locator and snap that to the wrist where my node is. I then freeze transformation on the locator so its position is 0 0 0 at the wrist. This is the same as the nodes rotatePivot. I then point constraint the locator to the elbow and get its co-ordinates. I then assign those to the rotatePivot of my node. Thats it, now my object stays in the same place and its pivot is by the elbow. I then delete the locator and any null constraints.

My solution works, but my question is whether or not its the easiest method. So please if anyone does have an easier method please share it with me. Keep in mind that this is a procedural script and I will need to adjust the position of the elbow depending on the model, so it will never have a constant position before I apply the rig.


04 April 2003, 04:39 PM
The xform command is your friend...

float afElbowPos [3] = `xform -q -ws -rp ElbowJoint`;

xform -ws -rp afElbowPos[0] afElbowPos[1] afElbowPos[2] WristLocator;

... or something like that.

Hope this helps,
Michael Duffy

04 April 2003, 05:32 PM
Okay, now I feel like a fool. That was really simple. I forgot that there was world space and object space. Thanks!!!


CGTalk Moderation
01 January 2006, 10:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.