- Practical Maya Programming with Python
- Robert Galanakis
- 177字
- 2021-09-03 10:05:26
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 is, there will be problems. Mistakes will be made. Edge cases exploited. Bugs found. Dealing with these errors is the topic of the next chapter.
- Mobile Application Development:JavaScript Frameworks
- Photoshop智能手機APP UI設計之道
- C#程序設計(慕課版)
- 精通API架構:設計、運維與演進
- Java Web應用開發技術與案例教程(第2版)
- Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
- Multithreading in C# 5.0 Cookbook
- Web性能實戰
- .NET 4.5 Parallel Extensions Cookbook
- Angular應用程序開發指南
- Java Web從入門到精通(第2版)
- Appcelerator Titanium:Patterns and Best Practices
- 30天學通C#項目案例開發
- Java程序設計教程
- Node.js應用開發