View Full Version : script to select everyother face of object

12-14-2011, 02:09 AM
can someone please give me a mel script which selects everyother face of any object ? Thanks you

12-17-2011, 11:39 AM
Heres a quick way to do it in python, I know you asked for mel but it should be easy enough to convert.

There is probably a better way to do it.

import maya.cmds as mc
mesh =[0]
faceCount = mc.polyEvaluate(f=True)

for face in range(0,faceCount,2):"%s.f[%s]" % (mesh,face), add=True)

12-17-2011, 02:22 PM
I guess in MEL this would look like this:

string $mesh[] = `ls -sl`;
int $faceCount = `polyEvaluate -f`;

for ($i = 0; $i < $faceCount; $i++) {
if(fmod($i, 2) == 0) {
select -add ($mesh[0] + ".[" + $i + "]");

CGTalk Moderation
12-17-2011, 02:22 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.