Wednesday, March 16, 2011

Week 3-Working with Components in Mel

This website has some thorough tutorials about Mel that really breaks the steps down and makes them easy.
http://www.mayavideotutorial.com/maya-scripting/maya-embedded-language/start-mel-2.html

I will demonstrate the concepts just with a different object to get practice. The author of the tutorial did this all in the Command Line of Maya, not the Script Editor.

First, the correct way to set up a script for working with components in Mel is to:
1. Select them.
2. Add the flag -r.
3. Include the name of the object.
4. Call the name of the object like it is a function
    by including a period after the name.
5. Write the first letter of the component you are accessing.
6. Treat it like an array of components and you are accessing a specific component,
 so provide a number within the brackets.

For example, I typed in polyCylinder; into the Maya Command Line and hit the number panel Enter Button.
It produced this result.


















I then worked with a face of the cylinder.
          select -r pCylinder1.f[2];

The object turned completely gray and selected the specific face.
I then decided to move the face that I selected with this code: move 2 2 2;.


















Accessing Components through Mel seems easy and very important to include in my studies later on.

No comments:

Post a Comment