PDA

View Full Version : Hotkey Multiplicity Script confusion


Velocamonkey
07-06-2003, 07:34 PM
Hi I saw a post a while back showing how you could assign numerous commands
depending upon what was selected to one hotkey:

-----------------

if ( size(`filterExpand -sm X`) > 0 )
{
COMMAND
}

where X is a number which define different selection. See the "Help > MEL Command References"
and look for "filterExpand". Theres a list of numbers you can replace with X.
And COMMAND is the command you want to execute.

-----------------

I'm completely new to Maya and indeed MEL so you can understand why I don't understand this.
This sounds really valuable to speed up my workflow so I was wondering if someone could
explain how I go about using this?

I assume it means, for example, that if my hotkey was k then when I press k when
a polygon face is selected I can have something different happen compared to if I were
to do the same when a vetex was selected? Is this what it does?

How would I do the example I have mentioned with the above script? And how do I actually
use the script, ie tie it to that hotkey? Thanks.

bigfatMELon
07-08-2003, 05:03 PM
I saw that script too and doing it that way has some value but it's not the easiest point at which to redirect a hotkey's functionality.

A simple approach for this would be to create a new, custom command for your hotkey that calls a script that evaulates the selection/panel focus/etc... and then does whatever you you want in that situation.

For instance, you could make a general purpose extrusion hotkey that evaulates the current selection and performs an edge or face extrusion. This avoids having to muck around with Maya's command definition stuff which is a bit thick for something this simple.

-jl

CGTalk Moderation
01-15-2006, 02:00 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.