PDA

View Full Version : Selection mode quick switch


BRUTICUS
11-08-2005, 01:16 PM
Im trying to simply change selection mode from vertex, edge, etc quickly with a HotKey. Anyone know how I can do this?

buildObjectMenuItemsNow "MayaWindow|mayaMainWindowForm|formLayout3|viewPanes|modelPanel4|modelPanel4|modelPanel4|modelPanel4ObjectPop";
dagMenuProc("MayaWindow|mayaMainWindowForm|formLayout3|viewPanes|modelPanel4|modelPanel4|modelPanel4|modelPanel4ObjectPop", "*");
doMenuComponentSelection("*", "vertex");
updateComponentSelectionMasks;
updateObjectSelectionMasks;



Also for any extremely ambitious script writers how bout a script that forces maya to save your selection between each selection mode. FOr example if you have selected some vertices and you go to edge mode and select some edges, then go back to vertex mode your vertices are still selected. Just like XSI.

mhovland
11-08-2005, 03:05 PM
F8 - Backs out to object mode
F9 - Vertex mode
F10 - Edge mode
F11 - Face mode

seven6ty
11-08-2005, 04:29 PM
Ah shit, I didn't know about F9,10 and 11, damnit. Oh well, I made my own little script to toggle through all the modes. It's kinda nice, it automatically will switch it to component mode - vertexes, if it had been in object mode. Then, it cycle through verts, UVs, Lines, faces, hulls, and then back to verts, for every time you push the button:

{
// If in ObjectMode, switch to ComponentMode, and set to VertexSelectionMode:
if (!`selectMode -q -co`) {
selectMode -co;
selectType -alc 0 -v 1;
}

// If no SelectionMode is set, set to VertexSelectionMode:
else if (!`selectType -q -alc`)
selectType -alc 0 -v 1;

// If set to VertexSelectionMode, toggle to PolyUVSelectionMode:
else if (`selectType -q -v` || `selectType -q pv`)
selectType -alc 0 -puv 1;

// If set to PolyUVSelection, toggle to LinesSelectionMode:
else if (`selectType -q -puv`)
selectType -alc 0 -eg 1;

// If set to LineSelectionMode, toggle to FacesSelectionMode:
else if (`selectType -q -eg` || `selectType -q -pe`)
selectType -alc 0 -fc 1;

// If set to FacesSelectionMode, toggle to HullSelectionMode:
else if (`selectType -q -fc` || `selectType -q pf`)
selectType -alc 0 -hl 1;

// If set to HullSelectionMode, toggle back to VertexSelectionMode:
else if (`selectType -q -hl`)
selectType -alc 0 -v 1;
}

MasonDoran
11-14-2005, 11:30 AM
whats wrong with alt-q ?

and to "save the selection"...find the alt-q marking menu and remove the "select -cl" in the mel file

JakobWelner
11-16-2005, 04:46 PM
BRUTICUS
I've tried to make a saveSelection script as you descriped.
It only works on poly edge- ,face- and vertices atm. but can easily be expanded to store whatever component you'd like it to.

saveSelection script (http://www.jakob.welner.dk/omtoolbox/OMT_to_saveSelectionToggle.mel)

set a hotkey to execute "OMT_to_saveSelectionToggle" which then toggles the feature on/off.
I will release this in the next version of OMToolbox but some comments beforehand could be nice. Like speed? it's possibly quite slow on big meshes.. and which component types should be included? Or should I _just_ make it work on everything?

Hope that it is useable.

BRUTICUS
12-06-2005, 03:14 PM
mhovland, seven6ty:

Thanks guys that does come in handy. However for some reason it doesn't work for my purposes. Im constantly converting face selections to UV selections and I like many people have my UV Texture Editor on my second monitor. What happens with this in maya 6.5 is that the Face/UV/Edge hotbox pops up on the left side and tis slows me down. When I try and convert faces to UVs for some reason in the UV editor I can't use the Hotkeys to go to UV selection mode without DESELECTING my selection. Which makes the whole process of converting my selection to UVs pointless unless I use the Mode Hotbox.

2byts, i'm not sure what you're talking about I dont get a hotbox with alt-q.. could you elaborate?

JakobWelner, thanks a lot man this looks very interesting and I appreciate you doing this. It seems to be on the right track for sure. However, im using 6.5 and it seems that only the first couple of times it will save the selection.. Do you have this problem as well? I will try this in Maya 7 at home and see if the problem is solved there. If you can figure this out you could probably solve the aforementioned problem as well.

Thanks for all your input guys.

sunit
12-06-2005, 03:27 PM
mhovland, seven6ty:

Thanks guys that does come in handy. However for some reason it doesn't work for my purposes. Im constantly converting face selections to UV selections and I like many people have my UV Texture Editor on my second monitor. What happens with this in maya 6.5 is that the Face/UV/Edge hotbox pops up on the left side and tis slows me down. When I try and convert faces to UVs for some reason in the UV editor I can't use the Hotkeys to go to UV selection mode without DESELECTING my selection. Which makes the whole process of converting my selection to UVs pointless unless I use the Mode Hotbox.


what about:

ctrl+f12

any of the ctrl combinations will convert your current selection to that component type.

cheers,
sunit

JakobWelner
12-06-2005, 04:27 PM
oh.. didn't know about the ctrl + F buttons.. neat :D

BRUTICUS
There is some weird bugs in the save selection script when switching with the "alt + q" menu, but using the F buttons [F8;F12] should work just fine! atleast on my computer it does. Both with Maya 6.5 and 7.
Just keep in mind that when clicking an F button corresponding to your current selection, you automatically deselects all components, which then gets stored in the save selection script, so this may appear to you as loosing the selection.

I have btw. personally made "ctrl + [1;5]" as hotkeys for the F buttons as I change the component type often when modeling, and I'm too lazy to move my hand all the way to the F buttons.
This seems to work fine for me and having all my other important hotkeys at the lest hand side of the keyboard ("Ctrl + a lot") my hand can stay quite stationary.
Just thought I would let you know :D

BRUTICUS
12-06-2005, 05:33 PM
what about:

ctrl+f12

any of the ctrl combinations will convert your current selection to that component type.

cheers,
sunit


Yeah I have that shortcut bound to my Alt+qwerts, but youll see that it does convert your selection to UVs but you still have to go into UV mode if you want add or subtract from the selection. And doing that a lot when your UVs are on the second monitor is annoying.

OK, so what is originally assigned to Alt+Q? I changed mine to convert selection to faces :D

sunit
12-06-2005, 09:27 PM
what about:

selectType -puv 1

this will convert your selection mode to polygon uvs. you can use this, for example, to convert anything to uvs:


select (`polyListComponentConversion -ff -fv -fe -fvf -tuv`);selectType -puv 1;

and visa versa, to faces:

select (`polyListComponentConversion -fuv -fv -fe -fvf -tf`);selectType -pf 1;

regards,
sunit

CGTalk Moderation
12-06-2005, 09:27 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.