FORUMS: list search recent posts

# world space of joint

VIEW ALL
 world space of joint on Mar 7, 2007 at 4:23:04 pm

I need to create a mel button that will
A) find the world space of a specific joint
B) Move a curve to that world space.

So basically, How can i at least find and store the world space of a joint?
should I create a vector variable and store there and then curve = vector variable?

I'm not a good mel scripter and Im not sure what the syntax would look like.

Thanks!!

 Re: world space of jointon Mar 7, 2007 at 10:14:16 pm

Finding the world space of a joint can be done with the pointPosition command:

pointPosition -world myJoint;

This will return the world space coords of the joint as an array of floats. You can capture this data using the following syntax:

float \$jointPositionArray[] = `pointPosition -world myJoint`;

After executing this command, the float array variable \$jointPositionArray will contain the x, y, and z coords of the joint in indices [0], [1] and [2] respectively.

Hope that helps,

-Steve

 Re: world space of jointon Mar 7, 2007 at 10:42:38 pm

Thanks Steve!,

I also got this solution as well... (Sorry for going to another site)

Just to keep the discussion open for a bit, I actually like your solution
because it's more natural to me to use an array. Also, I swear that I've
heard that there could be some problems with xform. Or am I wrong?

vector \$joint=`xform -q -ws -t joint1`;
xform -ws -t (\$joint.x) (\$joint.y) (\$joint.z) ;

Thanks!

 Re: world space of jointon Mar 8, 2007 at 3:09:18 pm

Don't apologize for going to another site--the COW is not the jealous type!

The xform solution works well, too, you're right. I don't know of any problems with xform, though of course it and pointPosition are specialized for different tasks. For this particular task, though, it seems the main difference is your preference of vector vs. float array values.

Thanks for the feedback,

-Steve