PDA

View Full Version : Query the Selection Type?


YourDaftPunk
07-21-2005, 06:26 PM
What is the mel command to query the type of selection? I want to know if a selection is edges, polys, or vertices. Thanks!

-shawn

Iconoklast
07-21-2005, 07:37 PM
look into the filterExpand command.

vaniljus
07-21-2005, 07:44 PM
It is done with the filterExpand -sm SOME NUMBER command.
Check the doc for the typ of selection you like to queary.

I have the following code on one of my markingmenus buttons, it allows me to extude a edge, face, vertex or use the splitpoly tool if the object is selected.

if ( size(`filterExpand -sm 12`) > 0 )
{
setToolTo polySplitContext;
}

if ( size(`filterExpand -sm 31`) > 0 )
{
performPolyExtrudeVertex 0;
}
if ( size(`filterExpand -sm 32`) > 0 )
{
performPolyChipOff 0 4;
}

if ( size(`filterExpand -sm 34`) > 0 )
{
performPolyChipOff 0 2;
}

YourDaftPunk
07-26-2005, 03:21 AM
Exactly what I needed. Thanks!

YourDaftPunk
07-26-2005, 10:01 PM
I just wanted to make a smarter delete. It takes three lines of mel to make a script that deletes edges, vertices, polys, and objects without going to Menu>Delete Edge / Vertice nonsense.

But how do you remap the delete key when you have a better delete script??

And why would Alias write so many million lines of code and have things as advanced as fluid dynamics and hair simulation without a delete that works as expected? Three lines! Everybody else has had it for years. Now let me hotkey delete at least, damnit ;^)

Suggestions?

vaniljus
07-26-2005, 10:05 PM
Put it on a hotkey or a marking menu.

john_homer
07-26-2005, 10:50 PM
But how do you remap the delete key when you have a better delete script??

a better delete ay???

are you aware that deleting an edge with the delete key and with "delete edge" have different results?
and that both are very usefull.

.j

vaniljus
07-26-2005, 10:57 PM
Hey, I didn't know that one.
Good to know.

YourDaftPunk
07-27-2005, 04:20 AM
Marking menu yes, but I can't seem to map the delete key. And when would you use delete on vertex or edge without using Delete Vertex/Edge? What's the result (on a laptop without maya right now)?

housewarmer
07-29-2005, 02:48 AM
Vaniljus: Your script is super fantastic. Poly modeling in maya becomes a one-button operation. Take that Modo & Silo!

john_homer
07-29-2005, 03:58 AM
And when would you use delete on vertex or edge without using Delete Vertex/Edge? What's the result (on a laptop without maya right now)?

delete edge also deletes verts that are on that edge (if they are not on another edge), delete key will leave them there..

.j

CGTalk Moderation
07-29-2005, 03:58 AM
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.