Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to select meshGeo that is skinned to joint using Mel?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
mostly_human
1215 Views, 4 Replies

How to select meshGeo that is skinned to joint using Mel?

If I only have a reference to a joint how do I select the mesh that the joint is skinned to? Thanks in advance for any help it is much appreciated!

4 REPLIES 4
Message 2 of 5
lee.dunham
in reply to: mostly_human

  1. Find the skin clusters (there could be more than one) connected to the joint.
  2. Get the mesh using the skin clusters.

 

Untested but should give the idea.

 

$skins[] = `listConnections -type "skinCluster"`;
$mesh = `skinCluster -geometry $skins[1]`;

 

Would recommend switching to python if you're able to.

 

Message 3 of 5
osidedan
in reply to: lee.dunham

What lee.dunham suggests will definitely work! He mentioned it is untested, so I gave it a quick test, and you just need to add a variable type on the first line, and a query flag on the second line for it to work:

string $skins[] = `listConnections -type "skinCluster"`;
$mesh = `skinCluster -q -geometry $skins[1]`;

 

Edit:
if you need to select the mesh, add this at the end:

select -r $mesh;

and if you need to select the transform instead, add this at the end instead:

$transform = `listRelatives -parent $mesh`;
select -r $transform;
Message 4 of 5
mostly_human
in reply to: osidedan

Thanks guys, very much appreciated!

Message 5 of 5
mspeer
in reply to: mostly_human

Hi!

 

@mostly_human 

Please mark every answer that solves your problem (or gives the correct answer) as solution, so others interested in this thread will get a better overview.

You can of course also mark your own reply as solution if it contains a solution or a "correct" answer.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report