![]() |
Welcome to
melscripting.com, home of MEL Scripting for Maya Animators Mark R. Wilkins and Chris Kazmier |
Praise for MEL Scripting for Maya Animators
This book fills a huge void of material on learning the MEL language... A great first step for Maya users who want to make the leap to becoming Maya technical directors.
– Doug Cooper, Digital Supervisor, DreamWorks Feature Animation
MEL Scripting for Maya Animators... is well written for both technical and nontechnical animators. It is an essential tool in making sophisticated animation not only possible but also practical.
– Henry LaBounta, Senior Art Director, Electronic Arts
About the Book
MEL Scripting for Maya Animators is the first comprehensive textbook on Maya expressions and the MEL scripting language written especially for the beginning animator or technical director.
The power of MEL for customizing Maya and automating time-consuming tasks has attracted almost all of the top animation and visual effects studios to Maya as their core tool in producing 3D animation. Now, you can learn to master that power even if you have little or no programming experience!
MEL Scripting for Maya Animators begins with an introduction to how Maya functions "under the hood," and proceeds through a series of examples to walk through the capabilities of Maya's expressions and MEL scripting. Next, the book provides an in-depth discussion of the MEL language and how to automate common tasks, and then shows how to build useful graphic user interfaces for your scripts.
Throughout the book's discussion of MEL, MEL Scripting for Maya Animators discusses the strategies that those new to programming must learn to think about programming problems in such a way that solving them becomes easy. At the same time, the book provides many useful tips and approaches that will be of interest even to those who already have programmed in MEL.
Finally, MEL Scripting for Maya Animators presents a wide range of specific examples of how MEL and expressions can be used in controlling dynamics, rigging characters, and even building a simple system for crowd behavior.
About the Authors
Mark R. Wilkins is a technical director at DreamWorks Feature Animation. Prior to DreamWorks Animation, he worked at PDI/DreamWorks, where he helped develop a production pipeline for commercials and visual effects production using Maya for effects and character animation. He has also worked at Walt Disney Feature Animation in a variety of positions including software engineer and scene setup supervisor. Mark has contributed to a number of feature films, including Minority Report, A.I., Mission: Impossible 2, Dinosaur, Hercules, and the upcoming DreamWorks animated feature Sinbad: Legend of the Seven Seas. Also, he has worked on a number of television commercial campaigns including spots for Intel, Kool-aid, Monster.com, and Target. Mark has taught various programming courses, including classes on MEL scripting and Perl programming for animators and technical directors.
Chris Kazmier is an effects animator/technical director at DreamWorks Feature Animation, where he works on effects for traditionally animated films and films completely animated by computer graphics. Previously, Chris worked at PDI/DreamWorks on the Intel Aliens and Kool-aid ad campaigns, and also worked at Fox Animation Studios as a 3D directing animator on Titan A.E., Bartok the Magnificent, and Anastasia. Chris has taught various computer graphics courses, including 3D animation for intermediate and advanced students.
Table of Contents
- Preface
- Special Acknowledgement
Chapter 1 – Maya Under the Hood
- In this chapter you will learn
- Why Look Under the Hood?
- The Dependency Graph, Attributes, and Connections
- Example 1: Using the Hypergraph to Explore the Dependency Graph
- Transform Hierarchy and Parent/Child Relationships
- Examining the Hierarchy
- Transform and Shape Nodes
- Example 2: Exploring Transform and Shape Nodes, Instancing, and History
- MEL and Maya's User Interface
- What to Remember about How Maya Works Behind the Scenes
Chapter 2 – The Basics of MEL Commands
- In this chapter you will learn
- Can I Use MEL Without Scripting?
- Command Line and Command Feedback Line
- Command Shell
- Script Editor
- Script Editor versus Command Shell
- Script Editor's Messages as MEL Code
- Making Shelf Buttons for a MEL Script
- Saving a MEL Script
- Seductive Dangers of the Status Message Area
- The whatIs Command
- Basic Structure of MEL Commands
- Where to Find Information About Maya and MEL on the Internet
- What to Remember About How to Use MEL Without Writing Scripts
Chapter 3 – Using Expressions
- In this chapter you will learn
- What Is an Expression?
- How Does an Expression Work?
- Equals Sign: Equality and Assignment
- How Maya Implements Expressions
- Is Maya's Expression Language the Same as MEL?
- When (and When Not) to Use an Expression
- Defining Relationships Between Attributes
- What Is Operator Precedence?
- Walkthrough of Maya's Expression Language
- Example 1: Eyes
- What to Remember About Using Expressions
Chapter 4 – Controlling Particles with Expressions
- In this chapter you will learn
- Two Kinds of Particle Object Attributes: Per Object and Per Particle
- All About Vectors
- Two Kinds of Expressions: Ordinary and Particle
- Example 1: Ordinary Expressions and a Newton Field
- Example 2: Simple Particle Expression
- A Few Hints for Efficient Particle Expressions
- Example 3: Helical Particles Around a Curve
- What to Remember about Particle Expressions in Maya
Chapter 5 – Problem Solving with MEL Scripting
- In this chapter you will learn
- MEL's Role in Maya: Building Scenes
- Strategies for Planning MEL Applications
- The Simplest User Interface
- Creating, Editing, and Querying Nodes in MEL
- Adding, Setting, and Getting Values of Attributes in MEL
- Connecting Attributes in MEL
- Creating and Connecting Expression Nodes in MEL
- Example 1: Using MEL to Automate Setup for Spiral Particles
- What to Remember About Writing MEL Scripts
Chapter 6 – Variables and Data Types
- In this chapter you will learn
- Declaring Variables (and Not Declaring Them)
- Environment Variables
- MEL Statements and Type Checking
- Simple and Aggregate Data Types
- What to Remember About Variables and Data Types in MEL
Chapter 7 – Using MEL Commands
- In this chapter you will learn
- What Is a MEL Command?
- Structure of a MEL Command
- Using MEL Commands in MEL Scripts
- Avoid Using MEL Commands in Expressions
- What to Remember About Using MEL Commands
Chapter 8 – Manipulating Nodes in MEL
- In this chapter you will learn
- Using ls Command to Find Nodes by Name or Other Properties
- Using select Command to Manage Object Selection
- Creating Nodes in a Maya Scene
- Finding a Node's Parents and Children
- Finding Information on Node Connections
- About Maya's Node Types and the DG Node Reference
- What to Remember About Managing Nodes in MEL
Chapter 9 – Controlling the Flow of Execution
- In this chapter you will learn
- Controlling the Flow of Script Execution
- Basic Conditional Operations: if-else and switch
- Loops
- What to Remember About Controlling the Flow of Execution in MEL
Chapter 10 – Procedures and Functions
- In this chapter you will learn
- Top-Down Design
- Example 1: A Trip to the Grocery Store
- What are Procedures and Functions?
- Example 2: Geometry-Constrained Locators
- Example 3: Recursive Antenna
- What to Remember About Procedures, Functions, and Top-Down Design in MEL
Chapter 11 – Naming Nodes, Scripts, and Variables
- In this chapter you will learn
- Why Naming Conventions Are Important
- Naming Scripts
- Naming Variables
- Naming Nodes
- Example 1: Adding a Name Prefix to Objects in a Hierarchy
- Example 2: Changing Name Prefixes in a Hierarchy
- What are Namespaces?
- Strategies for Using Namespaces
- What to Remember about Naming Scripts, Variables, and Nodes
Chapter 12 – Designing MEL User Interfaces
- In this chapter you will learn
- What is a User Interface?
- What Maya Users Expect to See from a MEL Script
- Questions to Answer Before Designing a User Interface
- Designing and Testing a User Interface
- Structure of a Dialog Box
- What to Remember About Designing User Interfaces in MEL
Chapter 13 – Simple MEL User Interfaces
- In this chapter you will learn
- Collecting Information from Users
- Validating User Input: When and Why
- Asking for Confirmation with confirmDialog
- Asking User for Text String with promptDialog
- Asking User to Pick File or Directory with fileDialog
- Handling Warnings and Errors with warning and error Commands
- Using Regular Expressions and match to Validate Data
- How Regular Expressions Work
- Validating Integers
- Validating Floating-Point Numbers
- Validating Object Names (Without Namespaces)
- Example 1: Simple Dialogs and Input Validation
- What to Remember about Simple MEL User Interfaces and Input Validation
Chapter 14 – Custom Dialog Boxes
- In this chapter you will learn
- How to Structure a Script that Uses a Custom Dialog Box for Input
- Dialog Boxes and Their Contents
- Example 1: Making the Example Dialog Box
- Common Types of Controls
- Common Types of Layouts
- Example 2: Dialog Box for Making Geometric Primitives
- What to Remember About Building Custom Dialog Boxes in MEL
Chapter 15 – Installing MEL Scripts
- In this chapter you will learn
- Installing a Script to Make It Available in All Scenes
- Installing a Script to Run When Maya Starts
- Installing a Script into a Script Node in a Scene
- Installing Custom Menus
- Managing Button Shelves and Creating Custom Shelf Icons
- What to Remember About Installing MEL Scripts
Chapter 16 – Examples Using MEL with Particle Dynamics
- Example 1: Introduction to Particle Goals
- Example 2: Particle Goals in a Surface
- Example 3: Using Goals on Multiple Surfaces
- Example 4: Using Goals on Multiple Surfaces, Part 2
Chapter 17 – Examples Using MEL with Solid Body Dynamics
- Example 1: Particle Collisions
- Example 2: Collision Events
- Example 3: Collisions Between Objects in Solid Dynamics
- Example 4: Solid Dynamics and Particles
Chapter 18 – Example of a Simple Crowd System
- Example 1: Creating a Vehicle
- Example 2: Vehicle Interaction
- Example 3: Vehicle Environment
- Example 4: Fine Tuning and Completing the Script
- Full Script Reference: crowdSystem.mel
Chapter 19 – Examples Using MEL in Character Rigging
- Example 1: Character Controls
- Example 2: Building a Character User Interface
- Full Text of mrBlahControls.mel
Appendix A – A MEL Script Design Checklist
- Specifying the Problem
- Implementing the Main Script
- Implementing the User Interface
- Afterword
- Index
- About the Web Site
Contact Us
We welcome your comments!
Errata: errata@melscripting.com
Mark Wilkins: mark@melscripting.com
Chris Kazmier: chris@melscripting.com