Message 1 of 7
MEL - Select Geometry ONLY within a selection

Not applicable
06-13-2017
08:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone,
I'm having trouble writing a MEL script that only selects geometry within a selection. For example: I have a hierarchy with groups, geometry, locators, 3d nodes, distanceDimensions, etc. I want it to select only the geometry within that selected hierarchy and nothing else, otherwise the script will error and won't continue on to the next portion.
Here's what I have so far:
// primary visibility TEST
string $selection[] = `ls -sl -s -dag`;
for ($node in $selection)
{
editRenderLayerGlobals -currentRenderLayer TEST;
setAttr ( $node + ".primaryVisibility") 0;
}
If I use 'ls -geometry'; it selects all the geometry in the scene, but I only want it to affect what is inside my selected hierarchy.
Thanks in advance,