PDA

View Full Version : List Selected Lights or Geometry


cgcreator
07-01-2003, 01:59 AM
i know you can list all objects with;

string $selectedObjects[] = 'ls -sl';

you can also list geometry;

string $listGeometry[] = 'ls -geometry`;

but you cannt just do;

string $selectedGeometry[] = 'ls -sl -geometry`;

how do you do it then...

Sanctuary
07-01-2003, 09:54 AM
check every object type



string $obj[];

for ($sel in $listGeometry)
{
if (`objectType $sel` == "mesh")
{
// add $sel to $obj[]
// btw i`m not sure if i`ve write the syntax corectlly so ... :)
}

}



hope this helps

wrend
07-01-2003, 01:48 PM
you can use ls -sl -geometry, if you have geom (eg mesh/nurbs shape) selected it will return.

also, ls -sl -type "nodeType", and filterExpand -sm "comp" for components.

mark_wilkins
07-01-2003, 01:55 PM
well, the reason that ls -sl -geometry doesn't work is that you're selecting the transform and not the shape.

you can do one of a couple of things. One is to list all the transforms with

ls -sl -transforms

and then call objectType on each one.

Another is to use the -dag flag:

ls -sl -dag -geometry

which will return the shape node names, and you can then find the parent transform using listRelatives BUT you'll get all of the geometry under whatever's picked in the hierarchy, not just what's selected.

-- Mark

galactor
07-01-2003, 02:59 PM
This is the way i should do it:


string $select[] = `filterExpand -sm 12 -sm 10 -sm 68`;


In the Mel docs you can find the selectionmasks that are available.
There are really a lot of them, the three i used (12, 10 and 68) are for polygons - nurbs and subd surfaces.

:: galactor ::

cgcreator
07-02-2003, 08:36 PM
Thanks the ls -sl -dag -geometry

cgcreator
07-02-2003, 08:36 PM
Thanks the ls -sl -dag -geometry

CGTalk Moderation
01-15-2006, 01:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.