Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I wanted to extract from any selection (meshes, locator, cameras, lights...) only the mesh objects.
As `ls -sl -typ mesh` returns nothing, I did this:
proc string [] ReturnMeshListFromSelection () { string $allMeshes []; string $selectedMeshes []; string $selection [] = `ls -sl -tr`; string $allMeshesShapes [] = `ls -typ mesh`; for ($obj in $allMeshesShapes) { string $transformNode [] = `listRelatives -p $obj`; $allMeshes [size ($allMeshes)] = $transformNode [0]; } for ($each in $selection) { if (stringArrayContains ($each,$allMeshes)) { $selectedMeshes [size($selectedMeshes)] = $each; } } return $selectedMeshes; }
It seems ok but i'm sure there is a smarter and shorter way to do this.
Anyone?
Solved! Go to Solution.