Mel Hot Keys Review Whats MEL o Maya

  • Slides: 17
Download presentation
Mel & Hot Keys Review

Mel & Hot Keys Review

What’s MEL? o Maya Embedded Language o Most of Maya's interface is built using

What’s MEL? o Maya Embedded Language o Most of Maya's interface is built using MEL commands and scripts.

Why Use MEL? o Bypass Maya's user interface, quickly create shortcuts, and access advanced

Why Use MEL? o Bypass Maya's user interface, quickly create shortcuts, and access advanced features. o Enter exact values for attributes, bypassing any restrictions to precision imposed by the interface. o Customize the interface for specific scenes, changing default settings to settings you prefer for a particular project. o Create MEL procedures and scripts that carry out custom modeling, animation, dynamics, and rendering tasks.

MEL in the Expression Editor o translate. Y = ball. translate. Z; Or o

MEL in the Expression Editor o translate. Y = ball. translate. Z; Or o ty = ball. tz; o ball. tx = 5 * sin (time); o tire. rz = - (tire. tx * (360. 0 / (2 * 3. 1415)));

MEL Scripts o All MEL commands must terminate with a semicolon o A MEL

MEL Scripts o All MEL commands must terminate with a semicolon o A MEL script file (*. mel) is a file that contains MEL commands, MEL procedures, or both. o A MEL script is used to execute a sequence of commands. o 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.

Where are the scripts? o By default, Maya looks for your MEL scripts in

Where are the scripts? o By default, Maya looks for your MEL scripts in your scripts directory. o By default, this location is o maya6. 0scripts

Where is the Script Editor? o Open by selecting Window > General Editors >

Where is the Script Editor? o Open by selecting Window > General Editors > Script Editor o Click (the Script Editor icon) at the bottom right of the Maya window

Edit Commands in the Script Editor Win Cmd Mac Cmd Description Ctrl+c Apple+c Copy

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

Opening a script o Opening a script doesn't execute it. It simply displays the

Opening a script o Opening a script doesn't execute it. It simply displays the script in the input section of the Script Editor. o To execute some or all of a script displayed in the input section of the Script Editor, n n highlight it with your mouse press your keyboard's numeric Enter key.

Sourcing a script o Sourcing a MEL script file executes all of the MEL

Sourcing a script o Sourcing a MEL script file executes all of the MEL commands and declares all global procedures that are contained within the script file. o If you modify a procedure in a script file, Maya will not register the changes to that procedure until you source its script file. n This is because Maya keeps executed procedures in memory.

Executing a script o Enter the script name in the command input (bottom portion)

Executing a script o Enter the script name in the command input (bottom portion) of the Script Editor and do one of the following: n n n press Ctrl + Enter press the Enter key on the numeric keypad select Edit > Execute from the Script Editor o 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.

MEL Scripts o All MEL commands must terminate with a semicolon o A MEL

MEL Scripts o All MEL commands must terminate with a semicolon o A MEL script file (*. mel) is a file that contains MEL commands, MEL procedures, or both. o A MEL script is used to execute a sequence of commands. o 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.

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

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

Sourcing a script o When you source a global MEL script, global procedures are

Sourcing a script o When you source a global MEL script, global procedures are declared. o 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.

Hotkeys o If you use a menu selection frequently, you may want to assign

Hotkeys o If you use a menu selection frequently, you may want to assign it to a hotkey. o You assign hotkeys in the Hotkey Editor (Window > Settings/Preferences > Hotkeys) window. o You can assign hotkeys to your own MEL scripts or to commands that accompany plug-in software.

How Hotkeys Are Saved o Maya saves your custom hotkey preferences so that they

How Hotkeys Are Saved o Maya saves your custom hotkey preferences so that they do not interfere with the default Maya hotkey settings. o Your preferences will not be overwritten when you upgrade to the next Maya version. o The file names containing hotkey preferences are user. Hotkeys. mel and user. Named. Commands. mel under user prefs directory: