- Print ISBN 9780123785787
Maya Python for Games and Film is the first book to focus exclusively on how to implement Python with Maya. Written by trusted authorities in the field, this in-depth guide will help you master Maya Python, whether you’re a seasoned technical artist looking to make the transition from MEL to Python or an aspiring artist not wanting to scramble for information.
With this book, you’ll:
--Intermediate level Maya users who may have some understanding of Maya's longstanding scripting interface, MEL, and are moving to Python for Maya scripting.
--Intermedia level Python users.
--Job titles: Professional Technical Artists or Tools Programmers in the video game or film industries.
--Students in technical or vocational programs who are pursuing careers in the above-listed fields.
Introduction To Maya Python
Project: Contrast a MEL and a Python API version of a Flatten Mesh script
Goal: This introductory chapter explains what the book is about and will excite readers about the possibilities Python affords them in Maya. We provide them a simple script, both a MEL version and a Python API version, that flattens a dense mesh to show them a quick example of some of the dramatic performance boosts they will learn how to harness. Fundamentally, this chapter will help highlight why readers bought the book, what they can expect to learn, and why it is so cool!
Part 1. Command-Level Python in Maya
Chapter 1. The Maya Command Engine and User Interface
Project: Input simple commands using script editor
Goal: This chapter briefly describes the basic low-level structure of Maya by focusing on its command engine. A more detailed description of the architecture appears later in the section dealing with the API. Following this description, we briefly examine Maya's three programming interfaces and what each is best suited for. Finally, we introduce readers to Maya's script editor and command line so they can begin entering simple commands and know where to find their output.
Chapter 2. Python Basics
Project: Translating basic MEL operations into Python
Goal: This chapter provides a brief overview of the Python language for new users. We first examine the principles of Python syntax (declarations, white space, operators) and compare Python to MEL (variable typing, semicolons). We then introduce Python's core object types and explain how reference counting works in relation to mutable/immutable data types and simple/complex data types. Finally, we explain what modules are and how they differ from the source command in MEL. We explain what import does, how to load and reload modules (math and sys), and where the command looks for modules. Finally, this cha