Book Image

Practical Maya Programming with Python

By : Robert Galanakis
Book Image

Practical Maya Programming with Python

By: Robert Galanakis

Overview of this book

Table of Contents (17 chapters)
Practical Maya Programming with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing the error handler


So far, our exception hook is installed (assigned to maya.utils.formatGuiException) when the excepthandling module is imported. This is a problem because it means excepthandling needs to be imported for the exception hook to be assigned. If you have a whole suite of tools, you will need to make sure excepthandling is imported early on. If you are distributing lots of separate tools, you will want to make sure each one imports excepthandling.

There is another problem, though. Imagine two people have read this chapter and created their own excepthook replacements which are assigned over maya.utils.formatGuiException. These two people then write and release some scripts. These two scripts are then installed by the same user. What would happen?

Obeying the What If Two Programs Did This rule

The What If Two Programs Did This rule is a technique to evaluate features and designs by asking the question: What if two programs did this? It comes from Microsoft programmer Raymond...