Select every other edge?

Select every other edge?

Anonymous
Not applicable
44,441 Views
32 Replies
Message 1 of 33

Select every other edge?

Anonymous
Not applicable

Hello, guys.

Can anybody remind me the script in MEL how to select every other edge?

Thanks in advance.

44,442 Views
32 Replies
Replies (32)
Message 2 of 33

Anonymous
Not applicable

Hi,

 

Simply call:

InvertSelection;
0 Likes
Message 3 of 33

Anonymous
Not applicable

Thanks, but it not what I want.

"Invert selection" - just inverting the selection.

But i want to select one face (or edge) - then one skip - again select - again skip...etc..

Message 4 of 33

mspeer
Consultant
Consultant

Hi!

 

There is nothing like "select every nth component" in Maya.

0 Likes
Message 5 of 33

Anonymous
Not applicable

there was a script for Maya 2015 or 2016 i don`t remember

0 Likes
Message 6 of 33

Anonymous
Not applicable

This script should do it, maybe there are better ways, not sure. 

 

 

// Get node of selected edge
string $nodeName = "pSphereShape1";
 
// First/Starting edge index
int $edgeStart = 0; 

// Get the number of edges from the node int $edgeCount[] = `polyEvaluate -edge $nodeName`; if (size($edgeCount) > 0) {
// Clear the selection select -clear; int $e;
// Loop through all edges and add every second edge to the selection for ($e = $edgeStart; $e < $edgeCount[0]; $e += 2) { select -add ($nodeName + ".e[" + $e + "]"); } }

 

0 Likes
Message 7 of 33

Anonymous
Not applicable

thank you, i`ll try it.

0 Likes
Message 8 of 33

Anonymous
Not applicable

Hey,

 

You can use these depending on what you need to select. Select an edge and execute.

polySelectEdgesEveryN "edgeRing" 2;

polySelectEdgesEveryN "edgeLoop" 2;

 

Cheers,

Fearwar

Message 9 of 33

mspeer
Consultant
Consultant

Hi!

 

In Maya 2018 for command polySelect there is a new option -everyN.

Message 10 of 33

PixelDeluxe
Enthusiast
Enthusiast

Cheers for that, it worked perfectly!

0 Likes
Message 11 of 33

Anonymous
Not applicable

where it is? i can`t find

 

0 Likes
Message 12 of 33

Roland.Reyer
Autodesk
Autodesk

In the Bonus Tools for Maya 2018 you find it under "Modelling->Select every Nth Edge in a Loop/Ring"

 

The Bonus Tools can be found here: https://area.autodesk.com/bonustools/

 

Message 13 of 33

Anonymous
Not applicable

thanks a lot

0 Likes
Message 14 of 33

nandooo_
Enthusiast
Enthusiast

You are a genius!

 

Is that possible to make this script work also for selecting every other face and vertex?

Message 15 of 33

Anonymous
Not applicable

This guy...Heart

Do you have a solution for faces as well perhaps?

Message 16 of 33

Anonymous
Not applicable

with latest Bonus tool its very simple to select every n- edge, it have this tool

0 Likes
Message 17 of 33

JHShark
Observer
Observer

Found this blog:

http://mayazest.blogspot.se/2017/07/select-every-other-edge-loop.html

 

Worked in Maya 2018.

Test selecting an edge and using this:


polySelectEdgesEveryN "edgeRing" 2;

0 Likes
Message 18 of 33

Anonymous
Not applicable

Nice solution, looks like mine 🙂

0 Likes
Message 19 of 33

JHShark
Observer
Observer

Ah true, missed it 😛

Message 20 of 33

Anonymous
Not applicable

I have 2018 and 2019 LT. I ran the MSI and was informed that install was successful but it does not show up in 2019 and I have no way of really knowing if it worked for 2018 as I already have bonus tools installed for 2018 and am not familiar enough with it to know if any changes were made.

0 Likes