Book description
Unleash the power of Python in Maya and unlock your creativity
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.
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
Table of contents
-
Practical Maya Programming with Python
- Table of Contents
- Practical Maya Programming with Python
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. Introspecting Maya, Python, and PyMEL
-
2. Writing Composable Code
- Defining composability
- Learning to use list comprehensions
-
Writing a skeleton converter library
- Writing the docstring and pseudocode
- Understanding docstrings and reStructured Text
- Writing the first implementation
- Breaking the first implementation
- Understanding interface contracts
- Extracting the safe_setparent utility function
- Learning how to refactor
- Simplifying the node to joint conversion
- Learning how to use closures
- Dealing with node connections
- Dealing with namespaces
- Wrapping up the skeleton converter
- Writing a character creator
- Improving the performance of PyMEL
- Summary
- 3. Dealing with Errors
- 4. Leveraging Context Managers and Decorators in Maya
-
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
- Creating the window
- Running a Python file as a script
- Introducing the QApplication class
- Understanding the event loop
- Running your GUI
- Designing and building your GUI
- Defining control, container, and window widgets
- Adding the rest of the widgets
- Hooking up the application to be effected by the GUI
- Hooking up the GUI to be effected by the application
- Simulating application events
- Considering alternative implementations
- Integrating the tool GUI with Maya
- Working with menus
- Working with Maya shelves
- Summary
-
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
- Creating a Python package
- Launching Maya from Python
- Automatically killing the server
- Creating a basic Maya server
- Running code at Maya startup
- Understanding eval and exec
- Adding support for eval and exec
- Adding support for exception handling
- Adding support for timeouts
- Adding support for the client-server handshake
- Practical uses and improvements
- Summary
- 7. Taming the Maya API
- 8. Unleashing the Maya API through Python
- 9. Becoming a Part of the Python Community
- A. Python Best Practices
- Index
Product information
- Title: Practical Maya Programming with Python
- Author(s):
- Release date: July 2014
- Publisher(s): Packt Publishing
- ISBN: 9781849694728
You might also like
book
Learning Python Application Development
Take Python beyond scripting to build robust, reusable, and efficient applications About This Book Get to …
book
The Blender Python API: Precision 3D Modeling and Add-on Development
Understand Blender's Python API to allow for precision 3D modeling and add-on development. Follow detailed guidance …
book
Python Deep Learning Projects
Insightful practical projects to master deep learning and neural network architectures using Python, Keras and MXNet …
book
Hands-On High Performance Programming with Qt 5
Build efficient and fast Qt applications, target performance problems, and discover solutions to refine your code …