Due to a miscommunication between Elsevier Press and the Python Software Foundation, the first printing of this title used an unauthorized modification of the trademarked Python logo. We apologize to the PSF for this, and they have been understanding of our in-press status; in the 2nd and subsequent printing of this title, we shall use a cover design that has been approved as non-dilutive by the Python Software Foundation.

Help make the world a better place and make a secure donation to the Python Software Foundation today!

 

Introduction

Welcome to Maya Python

Author

Ryan Trowbridge

Project

Contrast a MEL and a Python API version of a vertex noise script

Example Files

polynoise.py
polynoise.mel

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.


3 Responses to “Introduction”

  1. 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

  2. P.S I am using Maya 2012

    What version of python am i learning?

  3. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>