Help! convert selected object to components

I need help! how do I convert a selected object to component mode and have all of its vertices selected at the same time? keeping in mind that I won't have a fixed number of vertices everytime I use the script I'm using it for.

I've tried a "for" loop with select -add on the object's vtx's but it doesn't stop on the number of vertices my object has.

apparently a cube of 6 sides or whatever object has an infinite number of vertices.....

Once the object is selected, do this:

select polyListComponentConversion -tv;

whoops! it doesn't work! this command converts only from one component to another.

what i need is a way to convert an object mode to vertices.

thanks anyway!

There are a few commands that do this, getVerts, getEdges, getFaces, getUVs. They convert the current object selection into that component, also "returning" the names (so you can do $sel[] = getVerts to get the names as an array).

each one is actually a MEL script (they ship with Maya) so you can even get the relevent commands from within them if you don't want to actually use the full function...

:nathaN

thank you both! I think i got it.

Ugh, why the heck don't they document that stuff?! I can't even tell you the number of times I could have used that!

--JeffD

What do you need it to do? if you select an object and then run that command, it will convert the selection into vertices. Trust me it works, i use it all the time, in fact i just tried it. . .

Yeah, the only thing I don't like about it is that it actually selects the verts as opposed to just retrieving the list. I find that selecting is one of the slowest things you can do in a script.

In the past I have alwaysjust built a string like...

objectName.vtx[0:size(polyEvaluate -v $objectName)]

--JeffD