On Fri, Feb 20, 2009 at 17:31, <[email protected]> wrote: > Trying to have better error checking for a custom Maya API Command: > > If you messed the argument types in a Python command from Maya.cmds it tells > you what is wrong. > For example: > cmds.xform('nurbsSphere1', t=('spam','spam',1) ) > Results: > # TypeError: Invalid arguments for flag 't'. Expected ( distance, distance, > distance ), got ( str, str, int ) # > > In my custom command the MArgDatabase returns an exception when I butcher > the argument type: [...] > Sure, the exception will stop the command from working but the user will not > know why. Can this be done in Python?
MArgDatabase should print out an information message for you. Perhaps you've failed to notice it because of the exception? You should be able to just trap the exception and return. If you do that and still don't see an informative error msg, let me know. -- -deane --~--~---------~--~----~------------~-------~--~----~ Yours, Maya-Python Club Team. -~----------~----~----~----~------~----~------~--~---
