Mel - PowerPoint PPT Presentation

About This Presentation
Title:

Mel

Description:

Click (the Script Editor icon) at the bottom right of the Maya window ... Ctrl a Apple a Select all the text in the edit box. Opening a script ... – PowerPoint PPT presentation

Number of Views:181
Avg rating:3.0/5.0
Slides: 18
Provided by: SusanR87
Learn more at: https://www.cs.unca.edu
Category:
Tags: apple | bottom | mel

less

Transcript and Presenter's Notes

Title: Mel


1
Mel Hot Keys
  • Review

2
Whats MEL?
  • Maya Embedded Language
  • Most of Maya's interface is built using MEL
    commands and scripts.

3
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.

4
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)))

5
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.

6
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

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

8
Edit Commands in the Script Editor
Win Cmd Mac Cmd Description Ctrlc Applec Copy Ct
rlx Applex Cut Ctrlv Applev Paste
Ctrla Applea Select all the text in the edit
box
9
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.

10
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.

11
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 gt 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.

12
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.

13
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
14
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.

15
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 gt
    Settings/Preferences gt Hotkeys) window.
  • You can assign hotkeys to your own MEL scripts or
    to commands that accompany plug-in software.

16
(No Transcript)
17
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
Write a Comment
User Comments (0)
About PowerShow.com