Mel - Maya Embedded Language

<HOME>   <PREVIOUS>   <NEXT>

Commands

Melscripts are essentailly a list of commands that Maya executes. Each command has a list of arguments / flags associoated with it. These arguements can be assigned when you write out your command. If you do not assign them maya will use it's default settings for what ever command you are running. And, as you have probably figured, you can query or edit these arguments at a later time.

Help with Commands

Often times you may know the command you are coding but you may not know all of the flags associated with that command. There are a few places you can look to get help on commands. You can look online in Maya's Online reference: Help / Mel Command Reference or you simply use your script editor or Command shell by using the help command combined with the command you need help with.

help plane;
// Result: 

Synopsis: plane [flags]
Flags:
   -l -length    Length
-n -name String
-p -position Length Length Length
-r -rotation Angle Angle Angle
-s -size Length
-w -width Length

//
What you will notice here is that maya list the short flag name, the long flag name, and the value type associated with each flag.

Querying Commands

Another useful ability in maya is being able to query information from commands. To do this you need to specify the command, specify that you are querying information, the flag you want information on, and then name of the object you want the information from. You can only query one flag at a time.
polyCube -name Cubert -height 3.333;
polyCube -query -height Cubert;
// Result: 3.333 //

Edit Commands

Along with the ability of querying you can also edit information.
polyCube -name Cubert -height 3.333;
polyCube -query -height Cubert;
// Result: 3.333 //
polyCube -edit -height 3.123 Cubert;
polyCube -query -height Cubert;
// Result: 3.123 //
An important aspect of the edit command to remember is that you can edit more than one flag at a time.
polyCube -edit -height 3.123 -witdh 1.345 Cubert;

<Top>