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

Chapter 2. Writing Composable Code

In this chapter, we'll explore the concept of composable code. We start by defining the term. We then examine composable and non-composable examples to better understand what composability is, and improve code by refactoring. We will learn about important techniques to maximize composability, such as predicates, list comprehensions, contracts, closures, and docstrings. We put these techniques to work by building a library to convert a hierarchy of transforms into joints. After that, we compose this library into a configurable higher-level tool for creating characters. Finally, we will look at some issues and solutions surrounding PyMEL, composability, and performance.