PDA

View Full Version : Getting Skin Name from its Bone


jacobchen
06-08-2008, 02:06 PM
Hi everyone, this is my first post here, so if I say anything wrong, plz tell me.

I've been writing some mel scripts for building skeleton automatically and some simulation.
One thing I want to know is how to retrieve the name of a skin (the transform object) form its skeleton.

eg.

I have a mesh named pMesh1, smooth binded to a joint named joint1.
Now in mel, I only know there is this joint1 but don't know pMesh1.
How do I find this pMesh1 from just joint1?

I tried listConnections and listRelatives in some ways but couldn't get it work.
I found that hypergraph connections showed the connection between the skin and the bone through a skinCluster object, but I couldn't use the skinCluster to get the skin name in mel still...

I'd really like people here to help somehow.

Thank you~

RetroAnimator
06-08-2008, 04:18 PM
{
string $selJoint[] = `ls -sl`;
string $theCluster[] = `listConnections -t skinCluster $selJoint[0]`;
string $theMesh[] = `listConnections -t mesh $theCluster[0]`;
print $theMesh[0];
}


Gives you the transform node of the mesh which is binded to the selected joint. I don't get how you can't grab the mesh from the cluster node using listConnections, though.

jacobchen
06-08-2008, 05:48 PM
So that's how simple it is~

I didn't know this usage listConnections -t mesh (or anything else...) as there was no example for it in the API doc...

This is really helpful, thanks~

CGTalk Moderation
06-08-2008, 05:48 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.