It firstly explains why we need Python: using Maya's built-in scripting languages to avoid repeating works.Secondly, it compares Python versus MEL to indicate Python is much better than MEL. Thirdly, it explains the syntax of the code examples in this book, including white-space, line breaks, semicolon, quotation marks, comments. Finally, it gives two short code examples. They have same result, but one is wrote by Python and another one is MEL.
This two are the MEL version of this script. It made me surprised because Maya stopped responding after executing the MEL script. But finally, it shows the result in stead of crush (thank god!). The execution time is 57.52 seconds.
This is the distorted sphere in Maya viewport after I executed (Ctrl+enter) the two scripts.
Then, the book point out that no artist would want to use a script that takes a few minutes to execute. It would make the tool very difficult for artists to experiment with and most likely it would be abandoned. In the end, the author says you should be able to create scripts that are more complicated than even the example from this chapter by the end of this book, which makes me excited to get started leaning how to use Python in Maya, even I cannot read that code example right now.
No comments:
Post a Comment