Practical Maya Programming with Python

Unleash the power of Python in Maya and unlock your creativity

Practical Maya Programming with Python

Progressing
Robert Galanakis

Unleash the power of Python in Maya and unlock your creativity
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Want this title & more? Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.
+ Collection
Free Sample

Book Details

ISBN 139781849694728
Paperback352 pages

About This Book

  • Create and customize UIs using standard tools and libraries
  • Understand how Maya can leverage advanced Python features
  • Make your tools, and Maya itself, fully automatable

Who This Book Is For

If you are a developer looking to build a powerful system using Python and Maya's capabilities, then this book is for you. Practical Maya Programming with Python is perfect for intermediate users with basic experience in Python and Maya who want to better their knowledge and skills.

Table of Contents

Chapter 1: Introspecting Maya, Python, and PyMEL
Creating your library
Exploring Maya and PyMEL
Building the pmhelp function
Summary
Chapter 2: Writing Composable Code
Defining composability
Learning to use list comprehensions
Writing a skeleton converter library
Writing a character creator
Improving the performance of PyMEL
Summary
Chapter 3: Dealing with Errors
Understanding exceptions
Living with unhandled exceptions
Golden rules of error handling
Practical error handling in Maya
Building a high-level error handler
Installing the error handler
Improving the error handler
Summary
Chapter 4: Leveraging Context Managers and Decorators in Maya
Inverting the subroutine
Introducing decorators
Introducing context managers
Context managers for changing scene state
Creating the denormalized_skin context manager
Creating a decorator to record metrics
Advanced decorator topics
Summary
Chapter 5: Building Graphical User Interfaces for Maya
Introducing Qt, PyQt, and PySide
Establishing rules for crafting a GUI
Installing PySide
Supporting PySide and PyQt
Creating the hierarchy converter GUI
Integrating the tool GUI with Maya
Working with menus
Working with Maya shelves
Summary
Chapter 6: Automating Maya from the Outside
Controlling Maya through request-reply
Designing the automation system
Understanding the Maya startup routine
Building the request-reply automation system
Practical uses and improvements
Summary
Chapter 7: Taming the Maya API
Explaining types
Introducing Maya's API and architecture
Learning the Maya Python API by example
Creating a Maya Python plugin
Using PyMEL in a plugin that loads during startup
Summary
Chapter 8: Unleashing the Maya API through Python
Understanding Dependency Graph plugins
Demystifying Python metaprogramming
Designing the node factory
Building the node factory
Extending the node factory
Summary
Chapter 9: Becoming a Part of the Python Community
Understanding Open Source Software
Creating a site directory for third-party modules
Working with Python distributions in Maya
Contributing to the open source community
Engaging with the wider community
Summary

What You Will Learn

  • Understand the architecture of Python objects, Maya nodes, and PyMEL
  • Write composable code that is modular and re-usable
  • Make Maya "Pythonic" through the use of decorators and context managers
  • Learn about different Maya UI options and libraries
  • Use PySide and PyQt to build Maya user interfaces
  • Turn Maya into a server that can be controlled remotely
  • Understand how to use Python with Maya's API
  • Conquer custom nodes using Python's dynamic type creation

In Detail

Autodesk Maya is a 3D computer graphics software. It offers a vast and flexible set of features utilizing Python. It is not difficult to get started using Python in Autodesk Maya, but it can be difficult to go from writing procedural, MEL-inspired tools to building the powerful yet simple systems that Python promises.

Practical Maya Programming with Python will help you master both Python and Maya. With thorough explanations, illustrative examples, and complete sample projects, you will learn how to use Python to charm Maya into obeying your every command.  Practical Maya Programming with Python will teach you how PyMEL works as well as how to deal with errors and write composable code in Python.

Authors

Table of Contents

Chapter 1: Introspecting Maya, Python, and PyMEL
Creating your library
Exploring Maya and PyMEL
Building the pmhelp function
Summary
Chapter 2: Writing Composable Code
Defining composability
Learning to use list comprehensions
Writing a skeleton converter library
Writing a character creator
Improving the performance of PyMEL
Summary
Chapter 3: Dealing with Errors
Understanding exceptions
Living with unhandled exceptions
Golden rules of error handling
Practical error handling in Maya
Building a high-level error handler
Installing the error handler
Improving the error handler
Summary
Chapter 4: Leveraging Context Managers and Decorators in Maya
Inverting the subroutine
Introducing decorators
Introducing context managers
Context managers for changing scene state
Creating the denormalized_skin context manager
Creating a decorator to record metrics
Advanced decorator topics
Summary
Chapter 5: Building Graphical User Interfaces for Maya
Introducing Qt, PyQt, and PySide
Establishing rules for crafting a GUI
Installing PySide
Supporting PySide and PyQt
Creating the hierarchy converter GUI
Integrating the tool GUI with Maya
Working with menus
Working with Maya shelves
Summary
Chapter 6: Automating Maya from the Outside
Controlling Maya through request-reply
Designing the automation system
Understanding the Maya startup routine
Building the request-reply automation system
Practical uses and improvements
Summary
Chapter 7: Taming the Maya API
Explaining types
Introducing Maya's API and architecture
Learning the Maya Python API by example
Creating a Maya Python plugin
Using PyMEL in a plugin that loads during startup
Summary
Chapter 8: Unleashing the Maya API through Python
Understanding Dependency Graph plugins
Demystifying Python metaprogramming
Designing the node factory
Building the node factory
Extending the node factory
Summary
Chapter 9: Becoming a Part of the Python Community
Understanding Open Source Software
Creating a site directory for third-party modules
Working with Python distributions in Maya
Contributing to the open source community
Engaging with the wider community
Summary

Book Details

ISBN 139781849694728
Paperback352 pages
Read More