Does anyone know if it's possible to set the align to edge option for the translate tool in maya to a single hotkey?
The tool option is hidden inside menus and it's slowing down my workflow. The marking menu for this is ok but I'd rather not have to select the option and pick an edge, I'd like it to use whatever I already have selected or 1 step better, whatever my mouse is hovering over via pre-selection highlighting.
My goal is to eventually build a mel or python script (if it's possible) that uses pre selection highlighting to grab whatever edge my mouse is hovering over and then run the align to edge command without having to click anything and then assign it to a hotkey.
Perhaps this script or something similar already exists? If so I'd love to know where to find it!
Replies
Thanks Bartalon!
P.S. For me It's not retaining the current selection for some reason. I'm using maya 2014 extension.
EDIT: Seems like I have to click somewhere in the viewport for it to realize that it still has something selected. Anyway around this? Also perhaps instead of keeping the current(old) selection it could make the pre-selection the newly selected edge?
Now it will change to your selection to whatever your preselection is. Also I didn't get any issues with the selection mode not being recognized. Let me know if the problem persists and I'll look into it.
You rock man.
Everything is working perfectly
One last question!
Ok. So first off I've decided that my main usage will be your original script with retaining the current selection (the other one will be a secondary situational hotkey).
Is it possible to make the script switch back to multi component mode? Right now it drops me back into edge only mode. Which is fine except that when switching to multi mode manually after running the script it clears my selection as it enters multi component mode. (On the original script that keeps current selection)
I tried turning on echo all commands in the script editor but there was just too much going on in there to figure out exactly what Code I needed to switch back to multi-component selection mode. It's not a huge deal if it doesn't work. You've already given me a huge productivity boost.
I think it may be an inherent flaw in maya because it doesn't save multi component selections by default like it does with individual component modes.
EDIT: I also noticed that after using the "reset tool" option or selecting world space in the radial menu to go back to world space that the script no longer sets the translate tool to use a custom axis, even though I can see the custom axis changing in the tool settings box when using the script.
Yeah, I can't stand Maya 2014 because of the constant script editor feed so I usually work in 2013. This also means I don't have a whole lot of experience writing for things involving the Modeling Toolkit.
Glad I was still able to be some help, maybe someone else can modify what I have to work with the Modeling Toolkit.
P.S. I updated the script in my first post, the one that retains current selection instead of switching to the preselection.
Also it will now return you to multi component mode!
If in Edge, Face, or Multi mode, the script will look at what's pre-selected and set your manipulator to that edge's axis (or face normal). Running the script while nothing is pre-selected will reset the axis orientation settings (default is Object). Running the script with a vertex pre-selected will do nothing.
https://streamable.com/18xq
If you just want to test the script, make sure the script editor is active and, before executing the code, make sure your mouse is hovering over a component in the viewport.
Set the align to edge option for the translate tool? Align? Edge? to what, where?
I was kind of confused what exactly he means here and that the tool option is hidden inside menus...
Still can't see why the script for this when you can just hold W, E or R key + LMB and in marking menu choose mode you need.
Well, i guess we all have our own workflows so..
Edit: Nvm, it works but not how I imagined.
https://streamable.com/1hft
Edit2: Third time's a charm.
https://streamable.com/4vcm
First time I'm running the script it seems like it sets the manipulator to Normal average. Second time I run it sets to to edge, which is exactly what I want.
https://streamable.com/g7nv
[EDIT]
Script should now behave properly for 2015 and 2016. Works on faces and edges, but not vertices (for now, unless someone really wants it).
I updated the script above as well.
D + RMB will also pin the pivot...