- 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.
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- Moodle Administration Essentials
- Java入門經典(第6版)
- 程序員面試筆試寶典
- 動手玩轉Scratch3.0編程:人工智能科創教育指南
- AIRAndroid應用開發實戰
- C語言程序設計
- Symfony2 Essentials
- Mastering JavaScript High Performance
- 深入分析GCC
- Practical Predictive Analytics
- 基于GPU加速的計算機視覺編程:使用OpenCV和CUDA實時處理復雜圖像數據
- Ubuntu Server Cookbook
- C/C++代碼調試的藝術
- 走近SDN/NFV