Introduction
Welcome to Maya Python
Author
Ryan Trowbridge
Project
Contrast a MEL and a Python API version of a vertex noise script
Example Files
Synopsis
This introductory chapter explains what the book is about and aims to excite readers about the possibilities Python affords them in Maya. We provide a MEL version and a Python API version of a script, which adds vertex noise to a dense mesh, to show a quick example of some of the dramatic performance boosts readers will learn how to harness. Fundamentally, this chapter highlights what readers can expect to learn and why Python is so cool!
Resources
None
Other Notes
None
Errata for the First Edition
On p. xviii in the section on Line Breaks, the first MEL example has an errant closed parenthesis at the end of the third line.


Dear Ryan,
I’m an aspiring technical artist in animation, and I was recommended your book as a good launching point for Python in Maya. I got to the first exercise in the book about loading scripts, and I ran into an issue.
When I got to execute the polyNoise.py script in Maya I get this error:
# Error: NameError: name ‘time’ is not defined
I don’t really understand scripting yet to attempt to fix that problem…so any help would be appreciated.
Thanks!
Teresa Leong
P.S I am using Maya 2012
What version of python am i learning?
Hi Teresa,
If you execute the following code, you can see that Maya 2012 uses Python 2.6.4:
import sys
print sys.version
As for your other question, the script certainly should work. Make sure its entire contents are displayed in the Input Panel. Specifically, ensure that the third line is:
import random, time