Select every other edge?

Select every other edge?

Anonymous
Not applicable
44,384 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,385 Views
32 Replies
Replies (32)
Message 21 of 33

jacktoler1
Contributor
Contributor

Hey, so since you and @Anonymous asked about doing this but with vertices or faces instead of just edges, I figured that even if I don't know a way to do that with a specific script I do know how to kinda get that effect using this same script (polySelectEdgesEveryN "edgeRing" 2; AND polySelectEdgesEveryN "edgeRing" 4;). Here is a video kind of showing how to do so.

 

For faces:

Select-> Convert Selection

Create -> Sets -> Quick Select Set

 

For vertices:

Select -> Convert Selection

 

Obviously it takes extra time and work, and the way to do it with faces that I came up with also has to use quick select sets so it isn't as good as I'm sure a script or bonus tool on the internet would be, but I just figured I'd mention it. Let me know if it helps ya, or if you have a better way of doing this than I found!

0 Likes
Message 22 of 33

t_smith5
Collaborator
Collaborator

This sounds great, but is there a way of selecting every other edge in the UV Editor? I tried using this from the Bonus Tools but it doesn't appear to work on UVs. 😕 If there isn't an option somewhere I'm missing, maybe this is something that could be implemented in the near future...? :3

0 Likes
Message 23 of 33

jacktoler1
Contributor
Contributor
I'm not entirely sure if I understand the issue exactly, but if you have installed something and it does not immediately change anything within Maya, I would check the active plugins to see if it is there. Sorry if this is unhelpful, just figured it would be worth a shot.
0 Likes
Message 24 of 33

jacktoler1
Contributor
Contributor
I am not sure as to why that wouldn't work in the UV Editor, since I haven't used the tools myself, but I was wondering if you have tried selected the edges in the UV Editor then running either the polySelectEdgesEveryN "edgeLoop" 2;
script or the
polySelectEdgesEveryN "edgeRing" 2;
script through the MEL command area on the bottom left of Maya? That seems to work for me as the selected edges within the UV Editor are also selected on the model normally. If you can show some sort of video with the problem I may be able to understand better, assuming this "solution" doesn't work properly.
0 Likes
Message 25 of 33

t_smith5
Collaborator
Collaborator

Yeah, the edge loop script works perfectly fine when selecting every other edge in the UV Editor. It just would have been nice to have used a one-click method, rather than having to keep copying/pasting the line of code and executing it. 🙂

0 Likes
Message 26 of 33

jacktoler1
Contributor
Contributor

There is a way to create your own button that can run a script that may be helpful, but I would assume it would do the same exact thing as the button in the bonus tools. If you want help creating a tool that can select every other edge I can send over some screenshots later that can show how I tried making one for myself.


Its actually a bit more simple than I thought it would be so I'm sure anyone could make one themselves, but the code itself can be annoying find/write (especially if you want it to be more customizable in how many edges are skipped).
Feel free to let me know if you want to see my tool for it.

 

Otherwise best I could say is having a google doc that has all of the code you may want to have saved written in some kind of organized fashion, something like SECTION -> (name) -> (description) -> (code w/ x instead of values, can include multiple forms of the code such as edgeLoop and edgeRing) -> example of code: (fully written line of code that can be copy pasted in and just show how the code should look). I can also send a picture of my own code document for this specific line of code if that helps, but the document may only be necessary for you if you have multiple commands you want to remember.

0 Likes
Message 27 of 33

jacktoler1
Contributor
Contributor

Had some free time so I figured I would send a short video showing how the tool I created works. Not entirely sure if the code would work if someone else created their own tool making use of it, since I believe I messed with some other preferences, but I think it should function properly and can help if anyone would like to use the code I "wrote" for their own tool.

 

It opens up a window that allows the user to put in any number they wish and then press "Enter," and then it runs the script with that number added in. Sadly the buttons on the bottom of the window are useless but I figured it worked well enough for me. I'm not sure how this functions compared to the more "official" tool, but it works for me and I figured it would be a fun (although agonizing) exercise in coding within Maya.

 

Let me know if this is the effect you were looking for, or if I misunderstood your problem with the tool provided by others

Message 28 of 33

t_smith5
Collaborator
Collaborator

Sorry, I totally missed your previous post. I don't really have many lines of code I use, apart from the one mentioned here, so making a document with them wouldn't be worth it. 🙂

 

However, that tool you've demonstrated looks ace! I take it that also works with a complete edge loop too instead of just single edges...?

0 Likes
Message 29 of 33

jacktoler1
Contributor
Contributor
I appreciate it, though to be fair it is literally just taking some code for different tools and things I've found online and trying to put them together in a way that works. For the most part this tool is just a quick way to run the line of code without having to copy it from my Google Doc. Actually if you wanted to avoid the whole editing window thing that I did, you can just paste the code into a new tool and then edit the code manually every time you want to change the number of lines skipped. That may be faster than using a document outside of Maya itself and easier than creating a functional tool.

It does generally work with completed loops yes, though I will say if the number of edges aren't a perfect fit it will mess up slightly. If I use it on a cylinder and use the number 2 or 4, then it skips perfectly and only selects every second or every fourth edge, but if I use the number 3 it selects every third edge for the most part, skipping two edges each time, but only skips one edge at the very end of the loop.
Message 30 of 33

nadia.miltcheva
Explorer
Explorer

Maya bonus tools dont work at all about this. Have to use the script : polySelectEdgesEveryN "edgeRing" 2;
polySelectEdgesEveryN "edgeLoop" 2;

This is so ridiculous, Max has had this for million years in its base program and UI

Message 31 of 33

666696969128E1
Community Visitor
Community Visitor

working great.thanks for that..

0 Likes
Message 32 of 33

t_smith5
Collaborator
Collaborator

I've just installed the Bonus Tools for Maya 2023.3 and the Select Every N-th Edge in Loop/Ring is doing absolutely nothing for me. No other edges become selected at all. If I select the entire mesh, all it does is select every edge/loop. 😞 I'm using a simple ring primitive with a number of edge rings/loops going around and want to reduce the amount of them by deleting every other one.

0 Likes
Message 33 of 33

20160926002
Observer
Observer

Here is an example:

20160926002_0-1721987465633.png

 

* Create a cylinder.
* Choose an edge, and then select another edge that is not directly adjacent to the first one.
* Navigate to Bonus Tools > Modeling and click on the "Select Every N-th Edge in Loop/Ring" option.

 

Here is the result after clicking on the Select Every N-th Edge in Loop/Ring option:

20160926002_1-1721987577637.png


Every other edge selected.

 

@t_smith5 

0 Likes