Pattern Selection for Maya
Download at Gumroad ($0+):
Pattern Selection for MayaPattern Selection is a Maya-script that selects the next component in the currently selected pattern. Works for edges (loops & rings), vertices and faces. Best explained by the following GIF (sorry mobile folks, it's a bit large, all my compression attempts destroyed its informativeness too much):
Handy! Bringing a luxury feature from MODO to Maya!
Unfortunately the script does not support Maya LT (written in Python, leave a comment if you'd like to see it supported!). In theory works on any Maya version above 2012, but has only been tested on Maya 2016.5 and 2017 on Windows. I should test this more thoroughly, but I'm afraid that if I don't publish this now it'll just lay forever in my Dropbox.
Looking forward to your feedback! Did you get it installed? Did it work as expected? Do you find it useful? What additional things would you like the script do? Post feedback here in the Polycount thread or send me a PM.
============
INSTALLATION (I hope to make a video tutorial asap)
============
TLDR instructions:
1) Copy patternSelection.py somewhere in MAYA_SCRIPT_PATH
(e.g. C:/Users/cooluser1234/Documents/maya/2017/prefs/scripts)
2) Make a hotkey for the Python command ”import patternSelection; patternSelection.patternSelection()”
3) Restart Maya
------
*NOTE* If you make a shelf button for the script and it seems laggy, please try assigning it to a hotkey instead. I have no idea why it happens, but user & me found out that there's an extra slowdown. You're supposed to be able to mash the hotkey repeatedly with pretty much no lag, like in the GIF.
------
Long instructions:
Copy patternSelection.py to your scripts folder
(e.g. C:/Users/cooluser1234/Documents/maya/2017/prefs/scripts)
Open Hotkey Editor (Windows > Settings/Preferences > Hotkey Editor)
Go to Custom Scripts via the ”Edit Hotkeys for:” (Choose a category…) dropdown
In right-side panel open ”Runtime Command Editor” tab and make two new commands
Making new commands in Runtime Command Editor:
New --> Name it (e.g. ”PatternSelectNext”) --> script type (Python or MEL)
--> Save Runtime Command --> Assign hotkey on the left-side Custom Scripts panel
Commands and recommended keybindings below, but feel free to choose your own
(inspired by MODO, adapted to not conflict with pick-walking)
Bind ”import patternSelection; patternSelection.patternSelection()” to Ctrl+UpArrow (as Python)
Bind "Undo" to Ctrl+DownArrow (as MEL)
Save And Close when done in Hotkey Editor, then
File > Save Preferences and restart Maya
Replies
Thanks for the thanks If you guys have any comments or specific feedback on the script I'd love to hear it all!
Does it not already do that? The python reads like it does, and it acts like it does.
Also back on topic, @limeforce
Very nice script man reading through it was interesting.
@Kert To achieve the selection you're going for I'd first select a few edges along a loop with this script, convert the selection to edge rings ([Ctrl+RMB] Edge Ring Utilities --> To Edge Ring) and then to faces ([Ctrl+RMB] To Faces --> To Faces). Like this:
That's pretty unintuitive and longwinded though and I think I could add (whatchamacallit..?) Pattern Ring Selection as another command to the script. Should be easy but might take a while until I have time to do it. Thanks for the idea!
I would also like to have one-click pattern loop selection as an option (just like all the other similar scripts), no need to make the user run the script 20 times just to get the whole loop. But not too many more features, trying to avoid bloat.
@Mossbros Glad you like it! It's a pretty simple concept after all, tried to make the code understandable for future me and anyone else interested
@Joopson Yeah that's one of the cool things about this!
For faster selection of patterns along the circumference.
@TheGabmeister Same here, wanted it so bad that I made it haha!
@maksoon I do my day to day 3D work in Houdini nowadays so all things Maya dev have fallen to the wayside a bit. Seems like people are still finding this script useful so I think I will have a look at new fetures/tweaks sometime this week, stay tuned!
The script has now been updated to include another command called "patternSelection.patternSelectionRepeat()". Everything else should work just as before, but the new command will execute the script until nothing new is added to the selection. Same Gumroad page, just go redownload, replace the old script and add a hotkey for the new command.
Download at Gumroad ($0+): Pattern Selection for Maya
Keep in mind that if you have an evenly spaced selection (every 2nd, 4th, 6th selected) and use it on a loop/ring with odd number of verts/edges/faces it will keep going around the loop/ring twice or more and select everything on that loop/ring. Might feel counterintuitive, but is actually expected behaviour.
A lot of spam in Script Editor still, looks annoying & degrades performance (the new command has a bit of a delay to it). Didn't find a way to get rid of it yet (tips appreciated!).
Running out of laptop battery, still got improvements I want to do on the script & instructions.
Any feedback, problems etc -- let me know!
Back when I wrote this script I spent a lot of time in Maya so a Maya LT/MEL rewrite of the script was on my mind. Haven’t used Maya much in the last year and getting back into it to rewrite the script is way more effort than I have time and energy for these days. So please don’t expect a Maya LT version anytime soon.
Of course if someone else feels they’re up for the task of converting my code to MEL, please do and share your results
Many thanks limeforce - excellent work my friend
Maybe I’ll work on some more tools in the future again... any ideas? ✨
The script doesn't work in Maya 2022
"C:\Program Files\Autodesk\Maya2022\bin\mayapy.exe" -m pip install --user pymel
C:\Program Files\Autodesk\Maya2020\scripts\others\polySelectEdgesPattern.mel