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, ...
Get Practical Maya Programming with Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.