MEL How-To #54 | ||
| ||
How do I get an expanded list of selected components instead of the default "range" format?Typically Maya returns a list of selected components using its "range" format where an index sequence is compressed to "[start:end]". ls -sl; // Result: pSphere1.f[73:76] // There are several methods you can use to retrieve a fully expanded list. ls In Maya v3 a ls -sl -flatten; // Result: pSphere1.f[73] pSphere1.f[74] pSphere1.f[75] pSphere1.f[76] // The string $adjacentComponents[] = { "pSphere1.f[26:27]", "pSphere1.vtx[1:3]" }; // Result: pSphere1.f[26:27] pSphere1.vtx[1:3] // ls -flatten $adjacentComponents; // Result: pSphere1.f[26] pSphere1.f[27] pSphere1.vtx[1] pSphere1.vtx[2] pSphere1.vtx[3] // Note that items in your arbitrary list must actually exist within the current scene, else
the ‘ filterExpand The ‘ filterExpand -selectionMask 34 -expand true; // Result: pSphere1.f[73] pSphere1.f[74] pSphere1.f[75] pSphere1.f[76] // | ||
Copyright ©2005 by Bryan Ewert, maya@ewertb.com Maya is a Registered Trademark of Alias |