17
Mel & Hot Keys Review

Mel & Hot Keys Review. What’s MEL? Maya Embedded Language Most of Maya's interface is built using MEL commands and scripts

Embed Size (px)

Citation preview

Page 1: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Mel & Hot Keys

Review

Page 2: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

What’s MEL?

Maya Embedded Language Most of Maya's interface is built using

MEL commands and scripts.

Page 3: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Why Use MEL?

Bypass Maya's user interface, quickly create shortcuts, and access advanced features.

Enter exact values for attributes, bypassing any restrictions to precision imposed by the interface.

Customize the interface for specific scenes, changing default settings to settings you prefer for a particular project.

Create MEL procedures and scripts that carry out custom modeling, animation, dynamics, and rendering tasks.

Page 4: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

MEL in the Expression Editor

translateY = ball.translateZ;

Or ty = ball.tz; ball.tx = 5 * sin (time); tire.rz = - (tire.tx * (360.0 / (2 * 3.1415)));

Page 5: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

MEL Scripts

All MEL commands must terminate with a semicolon

A MEL script file (*.mel) is a file that contains MEL commands, MEL procedures, or both.

A MEL script is used to execute a sequence of commands.

When you execute a MEL script, it does not become part of the scene; you must execute the script each time you want to repeat the action.

Page 6: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Where are the scripts?

By default, Maya looks for your MEL scripts in your scripts directory.

By default, this location is

maya\6.0\scripts

Page 7: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Where is the Script Editor?

Open by selecting Window > General Editors > Script Editor

Click (the Script Editor icon) at the bottom right of the Maya window

Page 8: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Edit Commands in the Script Editor

Win Cmd Mac Cmd Description

Ctrl+c Apple+c Copy

Ctrl+x Apple+x Cut

Ctrl+v Apple+v Paste

Ctrl+a Apple+a Select all the text in the edit box

Page 9: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Opening a script

Opening a script doesn't execute it. It simply displays the script in the input section of the Script Editor.

To execute some or all of a script displayed in the input section of the Script Editor, highlight it with your mouse press your keyboard's numeric Enter key.

Page 10: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Sourcing a script

Sourcing a MEL script file executes all of the MEL commands and declares all global procedures that are contained within the script file.

If you modify a procedure in a script file, Maya will not register the changes to that procedure until you source its script file. This is because Maya keeps executed

procedures in memory.

Page 11: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Executing a script

Enter the script name in the command input (bottom portion) of the Script Editor and do one of the following: press Ctrl + Enter press the Enter key on the numeric keypad select Edit > Execute from the Script Editor

If no part of the MEL script definition fails, then the definition is moved from the bottom portion to the top portion of the Script Editor.

Page 12: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

MEL Scripts

All MEL commands must terminate with a semicolon

A MEL script file (*.mel) is a file that contains MEL commands, MEL procedures, or both.

A MEL script is used to execute a sequence of commands.

When you execute a MEL script, it does not become part of the scene; you must execute the script each time you want to repeat the action.

Page 13: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

time -A Predefined Variable in Maya NOTE: the following table assumes a frame rate of 24 fps.

Frame Time (seconds)

0 0.0

1 0.0417

2 0.0833

3 0.125

24 1.0

240 10.0

Page 14: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Sourcing a script

When you source a global MEL script, global procedures are declared.

If you declare a local procedure by entering it in the Script Editor or Command Line, the procedure is declared globally and you can execute it at any time.

Page 15: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

Hotkeys

If you use a menu selection frequently, you may want to assign it to a hotkey.

You assign hotkeys in the Hotkey Editor (Window > Settings/Preferences > Hotkeys) window.

You can assign hotkeys to your own MEL scripts or to commands that accompany plug-in software.

Page 16: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts
Page 17: Mel & Hot Keys Review. What’s MEL?  Maya Embedded Language  Most of Maya's interface is built using MEL commands and scripts

How Hotkeys Are Saved

Maya saves your custom hotkey preferences so that they do not interfere with the default Maya hotkey settings.

Your preferences will not be overwritten when you upgrade to the next Maya version.

The file names containing hotkey preferences are userHotkeys.mel and userNamedCommands.mel under user prefs directory: