Construction Of A Single Window MEL (MAYA)

One of the most satisfying elements of MEL scripting is the creation of custom windows, or GUIs.
If you’re relatively new to the world of scripting, however, the MEL code can be very intimidating.
With that in mind, this section boils down MEL windows into their most basic components.
The following MEL script makes a simple window with two drop-down menu options,

two buttons, and a short text message:
window -title “Simple Window” -menuBar true newWindow;
menu -label “Options”;
menuItem -label “Save File” -command “file -f -save”;
menuItem -label “Exit Maya” -command “quit”;
columnLayout;
button -label “Scale Up” -command “scale -r 2 2 2”;
button -label “Scale Down” -command “scale -r .5 .5 .5”;
text -label “Click me!”;
showWindow newWindow;

This script is saved in Chapter 1 simple.mel MEL folder on the CD. Uses, open Script Editor, choose File ➔ the script font, and locate the file. The window MEL immediately. You can also paste text into the workspace Script Editor, you must highlight And MMB drag it to the shelf to create a shelf icon. You are free to use any command in the budget after each prompt, either used for a menu item or button. If you are wondering what are the available commands, see longer than the script editor. Every single transformer, operation and tools in Maya an MEL line associated with it. For example, if you put a bullet and a line similar to this appears:

Move R 8.110931 -16.289322 10.206124; If you create a standard bulb, this line appears:
ball-p 0 0 0-ax 0 1 0 0 NO ESW-360-R 1-D, 3-ut TOL 0.01-s 8-DK 4-1 lm, motion control object; Even if the ball is a huge number of command option flags (the flag is a line and several letters, such as p-or-ax), you do not use them all. Sphere itself is enough. The same is true of tools. For example, rebuilding the instrument surfaces to print this: rebuildSurface CH-1-1-0-end RPO RT 1-0-0 KCP KR  Kc-0-4-3-4-on du dv fi fr 3-tol 0.01 0 Dir-2 "nurbsSphere";


Commands that use the buttons and menus are not limited to the tools and operations such as File-Save and exit. You can also start Windows Maya. For example, HypergraphWindow open the Hypergraph window, and open the Graph Editor GraphEditor. You can see the MEL connecting pipes with Windows, select History ➔ Echo All Commands in the Script Editor. Note that a MEL scripting is case sensitive. Returning to the command simple.mel columnLayout script allows you to add as many like the layout of the buttons you want. By default, they are stacked vertically. The layout of the controls Compulsory basic MEL windows. You have to choose rowColumnLayout, rowLayout, or columnLayout, each of which has the window in their name. You can add Extras menu with the addition of extra lines MENUITEM. If you want more than one drop menu, add additional menu items. The text command offers an easy way add a message to a window. Whatever the message you want to appear when you insert quotation marks after the flag etiquette.

On the first line in the script, describes the command window GUI window. On last row, window Newwindow launches the specified window. A variant of the window command is necessary if the pop-ups you want. If you insert a new MEL script or adapt for example, and the script runs, the red error message on the command line. If Maya is a problem with a particular part of the script, you add a brief explanation Script Editor. Normally, crushed MEL script is the result of a typo, a misspelling, or a missing semicolon, which should appear at the end of each command (except the with an opening or closing braces {}).

Post a Comment

Previous Post Next Post