Hi guys
New user here.
Here is my situation. I am working on a scene(MAYA) with thousands of objects, but I don't need the objects that are smaller than a certain size. Is there are a way(maybe a script) of selecting multiple objects in a scene that are smaller than a size you specify(xyz scale)? This will speed up my workflow tremendously.
Thank you in advance!
VBV
Replies
<div>global proc GetSmallObjects( float $xLimit, </div><div> float $yLimit, </div><div> float $zLimit ){ </div><div> </div><div> string $sceneObjs[] = ` ls -l `; <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "open sans", sans-serif;"> select -cl;</span> </div><div> </div><div> </div><div> for ($obj in $sceneObjs){ </div><div> float $bbox[] = ` exactWorldBoundingBox $obj`; </div><div> </div><div> float $xSize = $bbox[3] - $bbox[0]; </div><div> float $ySize = $bbox[4] - $bbox[1]; </div><div> float $zSize = $bbox[5] - $bbox[2]; </div><div> </div><div> if (( $xSize < $xLimit) && ( $zSize < $zLimit) && ( $zSize < $zLimit)){ </div><div> </div><div> select -add $obj; </div><div> } </div><div> } </div><div>}</div>where you run it from the command line like this:
GetSmallObjects( 1, 2, 3);
where the numbers are the x, y, z, sizes
Thank you!