class_01

 

Week 1:

Concepts:
  • Computer as a tool for form generation
  • Scripting Basics (The Scripting window, buttons, documentation)

    In class exercise:

    exercise 1


    Create a MEL button that with one click will make a cube, sphere and cone all lined up in a row.

    1. Using the basic modelling tools, create a sphere, cube and cone.
    2. Open the Scripting window by clicking on the scripting window button in the bottom right-hand corner of the interface.
    3. The commands for creating the sphere, cube and cone should appear in the scrpting window.
    4. Copy the sphere, cone and cube create commands into a text editor (WordPad or EditPlus). Using the text editor, edit the commands to create the objects at different locations. *

    For example, the command to create the cone will look like this: *

    cone -p 0 0 0 -ax 0 1 0 -ssw 0 -esw 360 -r 1 -hr 2 -d 3 -ut 0 -tol 0.01 -s 8 -nsp 1 -ch 1;

    If you edit the numbers after the '-p', you can change the location of where the cone is created. If you edit the command to look like this.

    cone -p 10 0 0 -ax 0 1 0 -ssw 0 -esw 360 -r 1 -hr 2 -d 3 -ut 0 -tol 0.01 -s 8 -nsp 1 -ch 1;

    The cone will be created at 10,0,0 (x,y,z) instead of (0,0,0). You can do the same for the sphere command.

    5. To test the new MEL commands you wrote you can cut and paste them into the bottom half of the Scripting window and hit Ctrl+Enter on the keyboard.

    6. After you have written a set of commands that will create a sphere, cone and cube. Select the text of the script in your text editor and drag it into the menu bar of Maya, when you are dragging the cursor should turn into a cursor with a plus (+) sign. When you release the mouse button, a new MEL button will appear in your menu bar.

    7. Click on the button to execute your script. Each time you login and start Maya this button will be there. To delete the button, click on it with the middle mouse button and drag it to the trash can on the right of the interface.


    *For more information about editing MEL scripts, use the MEL reference. http://www.arch.columbia.edu/manuals/Maya4.0/Commands/Index/index.html










  • class_01