catchQuiet is built to do this, but is in mel only...
So use mel.eval
But it doesn't get to the except situation...
Though you can use it in mel to quiet an if...
*
import maya.cmds as cmds
import maya.mel as mel
circle_X = cmds.circle(c=(1.1,0,0), nr=(0,1,0), s=8)[0]
circle_Y = cmds.circle(c=(-1.1,0,0), nr=(0,1,0), s=8)[0]
try:
mel.eval('catchQuiet ("curveIntersect circle_X circle_Y")') #warning
messages to suppress ...
except:
pass*
On Wed, Jan 14, 2009 at 10:28 AM, sberger <[email protected]> wrote:
>
> Hi, I am trying to suppress maya warning message, but the try:/except:
> clause don't supress it.
>
> Anyone know how to do this?
>
> Here is a peice of code that repro the problem
>
> import maya.cmds as cmds
> circle_X = cmds.circle(c=(1.1,0,0), nr=(0,1,0), s=8)[0]
> circle_Y = cmds.circle(c=(-1.1,0,0), nr=(0,1,0), s=8)[0]
> try:
> cmds.curveIntersect( circle_X, circle_Y ) #warning messages to
> suppress ...
> except:
> pass
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---