PDA

View Full Version : select ever nth vert


BobbyB
07-04-2009, 06:13 PM
I'm starting the get me head around mel script after being familiar with Maxscript

At the moment I am looking for a way the select every nth vert of an object.

so vert 1 then plus 33, vert 34 then plus 33 vert 67 and so on for every very in the object.

Any help will be much appreciated

Thanks

Rob

cbamber85
07-04-2009, 10:09 PM
I'm sure I remember this being less clunky:

string $sel[];
int $tot[] = `polyEvaluate -vertex pTorus1`;
for ($i = 0; $i < $tot[0]; $i += 33){
$sel[$i] = ("pTorus1.vtx["+$i+"]");}

string $names = stringArrayToString($sel, " ");
eval("select "+$names);
Obviously change pTorus1 to whatever you're iterating through.

BobbyB
07-07-2009, 12:07 PM
Thanks for that.

Rob

Chadrik
07-08-2009, 05:57 AM
this is how you would do it using pymel:

from pymel select *
c = polySphere()[0]
select(c.vtx[::2])

CGTalk Moderation
07-08-2009, 05:57 AM
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.