Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to get only mesh from relatives

How to get only mesh from relatives

Anonymous
Not applicable
704 Views
3 Replies
Message 1 of 4

How to get only mesh from relatives

Anonymous
Not applicable

I try to get the mesh node from a transform node, but everytime I try it includes "surface" something as well, I don't want that, I just want the mesh, how can I accomplish this?

0 Likes
Accepted solutions (1)
705 Views
3 Replies
Replies (3)
Message 2 of 4

rajasekaransurjen
Collaborator
Collaborator
Accepted solution

Hi,

Try filterExpand command.

http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/Commands/filterExpand.html

string $selection [] = `ls -tr`; //lists all transform nodes in the scene.
string $selectedMeshes [] = `filterExpand -sm 12 $selection`; //filters out all the non-polymesh nodes.

https://forums.autodesk.com/t5/maya-programming/return-an-array-of-meshes-among-any-selection/m-p/88...

0 Likes
Message 3 of 4

Anonymous
Not applicable

filterExpand is a good shout!

 

Alternative would be mc.listRelatives(type="mesh")

https://download.autodesk.com/global/docs/maya2012/en_us/CommandsPython/listRelatives.html#flagtype

0 Likes
Message 4 of 4

Anonymous
Not applicable

The problem was that it returned a list, so I got a list of a list, once I got the first item in the list it went normal. Thanks anyway.

0 Likes