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

Designing the node factory


For the rest of this chapter, we will be creating a node factory library which will help create dependency graph plugins. It will provide the following benefits:

  • Less code and duplication. Creating nodes through the node factory requires 75-90% less code than an equivalent node created with the raw Maya Python API. The node declarations should also involve little to no duplication, as they only need to describe data and behavior unique to the node. The repetitiveness of working with the Maya Python API is hidden.

  • Intuitive and consistent. Using the node factory should be conceptually close to designing a Maya node and not require learning many new concepts. For example, we uphold the concepts of name, type ID, inputs, outputs, and compute, but provide a way of working with them that does not require knowledge of the Maya API. The node factory should also provide a consistent and complete abstraction, not requiring the user to jump between PyMEL and the API except...