Thanks much Paul: raise ValueError was what I was looking for. displayWarning and displayError are available when I just use from pymel.core import *
On May 6, 7:58 pm, Paul Molodowitch <[email protected]> wrote: > Pymel doesn't provide an error or warning function because autodesk didn't > provide a maya.cmds wrap for those. > > If all you want to do is DISPLAY an error / warning (with the appropriate > coloring) in the status window, you can use api.MGlobal.displayWarning / > displayError (the name is from memory, might be slightly different). > > If you want to raise an actual error, the standard python way to do that is > with the raise statement, and an appropriate Exception class. > > ie, > > if argIsBad(arg): > raise ValueError > > It might make sense to include MGlobal.displayWarning / displayError in the > pymel.core namespace, though, to make them more accessible... > > - Paul > > --http://groups.google.com/group/python_inside_maya -- http://groups.google.com/group/python_inside_maya
