You can write a little function that wraps this as well.
Then you can re-use it.
And it will feel more pythonic
###################
import maya.mel as mel
def pyWarn(warnString):
warnMe = 'warning "'+warnString + '"'
mel.eval( warnMe )
pyWarn('Hey There!')
On Tue, Dec 2, 2008 at 11:16 AM, NPuetz <[EMAIL PROTECTED]> wrote:
>
> You can use the mel module to evaluate that warning command in MEL.
>
> import maya.mel as mel
> mel.eval( 'warning "Hey There!"' )
>
> On Dec 2, 4:25 am, rambelly <[EMAIL PROTECTED]> wrote:
>> Hi Guys,
>>
>> How do I do the purple warning as in mel:
>>
>> warning("my warning message")
>>
>> in python - without quiting my script?
>>
>> At the moment I have:
>>
>> raise Warning("my warning message")
>>
>> But this produces a red error (i think because 'raise' is used).
>>
>> Thanks,
>> rambelly
> >
>
--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---