Book Image

Practical Maya Programming with Python

By : Robert Galanakis
Book Image

Practical Maya Programming with Python

By: Robert Galanakis

Overview of this book

Table of Contents (17 chapters)
Practical Maya Programming with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter, we learned how to write composable code. We saw examples of non-composable MEL style code, such as Maya's listing functions. We learned how to turn this legacy code into clean, composable functions, such as head, tail, first_or_default, and is_exact_type. We created a reusable library for converting a hierarchy of transforms into joints. We used that library for a configurable character creator module that can easily be called through a UI. Along the way, we learned about list comprehensions, contracts, selecting and filtering, closures, refactoring, docstrings, and improving PyMEL performance.

Writing composable code, and the topics in this chapter, are the foundation for a successful and enjoyable experience programming Python in general, and Python in Maya particularly. This is the way of the Pythonista.

Unfortunately, despite the composability of our functions, the care and craft of our projects, the documentation we provide, and no matter how Pythonic our code...