PDA

View Full Version : Switch to object mode


yinako
01-16-2006, 12:46 PM
I have a hotkey to escape back to object mode always, I use ~ key with following command:

string $selection[] = `ls -sl`;
changeSelectMode -object;
select -r $selection;

However this doesn't work if the commonent mode was acessed by right click on object -> vertex for example, I have to press it twice just like press F8 twice its annoying(essentially switching to comonent and back to object again). I want a key that switch back to object mode no matter the case. anyone?

brubin
01-17-2006, 12:31 PM
string $selection[] = `ls -sl`;
changeSelectMode -object;
select -r $selection;



ls -sl also returns components if components is what you have selected, so i believe -coming from a selection of let's say vertices would return a list of vertices for $selection, then you change to objectMode only to going back to selecting those components you remembered before. that doesnot make a lot of sense, if forcing objectMode at all cost is what you want/need.


if (!`selectMode -q -object`)
setSelectMode("object", "Objects") ;


will help you force objectMode where it's not prevailing.
but:
if you're in hilite-mode this will not help.

so it should be like this:

{
string $nodes[] = `selectedNodes` ; // gives you the names of dependency nodes on the active list, so if you if you have vertices of "sphere1" selected it will return "sphere1"
select -d `ls -sl` ; // deselect the vertices
hilite -unHilite $nodes ; // unHilite
select -r $nodes ; // select

// force objectMode
if (!`selectMode -q -object`)
setSelectMode("object", "Objects") ;
}


HIH
s.

CGTalk Moderation
01-17-2006, 12:31 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.