Cargando…

Practical Maya Programming with Python /

In Detail Autodesk Maya is a 3D computer graphics software. It offers a vast and flexible set of features utilizing Python. It is not difficult to get started using Python in Autodesk Maya, but it can be difficult to go from writing procedural, MEL-inspired tools to building the powerful yet simple...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Galanakis, Robert
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birming ham : Packt Publishing, 2014.
Colección:Community experience distilled.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Introspecting Maya, Python, and PyMEL; Creating your library; Using the interpreter; Finding a place for our library; Choosing a development root; Creating a function in your IDE; Reloading code changes; Exploring Maya and PyMEL; Creating an introspection function; Understanding Python and MEL types; Using the method resolution order; PyNodes all the way down; Understanding PyMEL data and math types; Leveraging the REPL; Building the pmhelp function.
  • Creating a query string for a PyMEL objectCreating more tests; Adding support for modules; Adding support for types; Adding support for methods; Adding support for functions; Adding support for non-PyMEL objects; Designing with EAFP versus LBYL; Code is never complete; Opening help in a web browser; Summary; Chapter 2: Writing Composable Code; Defining composability; Identifying anti-patterns of composability; Avoiding the use of Boolean flags; Evolving legacy code into composable code; Rewriting code for composability; Getting the first Item in a sequence; Writing head and tail functions.
  • Learning to use list comprehensionsImplementing is_exact_type; Saying goodbye to map and filter; Writing a skeleton converter library; Writing the docstring and pseudocode; Understanding docstrings and reStructured Text; Writing the first implementation; Breaking the first implementation; Understanding interface contracts; Extracting the safe_setparent utility function; Learning how to refactor; Simplifying the node to joint conversion; Learning how to use closures; Dealing with node connections; Dealing with namespaces; Wrapping up the skeleton converter; Writing a character creator.
  • Stubbing out the character creatorImplementing convert_hierarchies_main; Implementing convert_hierarchies; Decomposing into composable functions; Implementing convert_hierarchy; Supporting inevitable modifications; Improving the performance of PyMEL; Defining performance; Refactoring for performance; Rewriting inner loops to use maya.cmds; Summary; Chapter 3: Dealing with Errors; Understanding exceptions; Introducing exception types; Explaining try/catch/finally flow control; Explaining traceback objects; Explaining the exc_info tuple; Living with unhandled exceptions.
  • Handling exceptions at the application levelGolden rules of error handling; Focus on the critical path; Keep the end user in mind; Only catch errors you can handle; Avoid partial mutations; Practical error handling in Maya; Dealing with expensive and mutable state; Leveraging undo blocks; Dealing with Maya's poor exception design; Leveraging the Maya application; Dealing with the Maya application; Leveraging Python, which is better than MEL; Building a high-level error handler; Understanding sys.excepthook; Using sys.excepthook in Maya; Creating an error handler; Improving the error handler.