Maybe I’m being stupid here but I can’t seem to get the pm.warning to work.
The example:
import pymel.core as pm
pm.warning( "No Dice" )
# Error: 'module' object has no attribute 'warning'
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# AttributeError: 'module' object has no attribute 'warning' #
and
import pymel.all as pma
pma.warning( "No Dice" )
# Error: 'module' object has no attribute 'warning'
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# AttributeError: 'module' object has no attribute 'warning' #
Is this one of those broken things?
:?:
what version of pymel/maya are you using?
import pymel.core as pm
pm.warning(‘No Dice’)
works fine in 2012.
Yeah it appears that it isn’t working in Maya 2009 with pymel 0.9.
This works however:
import pymel.core as pm
pm.pwarnings.warn("Dice!")
Neither is it working with pymel 1.0.2.
This works however:
import pymel.internal.pwarnings as pmWarnings
pmWarnings.warn("Dice!")
Doing some more in depth investigation.
~B)
[QUOTE=DrBob;10405]Yeah it appears that it isn’t working in Maya 2009 with pymel 0.9.
I am checking with 1.0.2 now…
This works however:
import pymel.core as pm
pm.pwarnings.warn("Dice!")
Tell me how that goes for ya rhexter
~B)[/QUOTE]
Hmmm…that being the case, my guess is it wouldn’t work prior to 0.92 or 0.93, but I don’t get why it wouldn’t work in 1.0…time to check the changelogs.
alternatively you can you:
import pymel.core as pm
pm.mel.warning("Dice!")
Working with Seth at the mo to get to the bottom of this.
~B)
[QUOTE=DrBob;10407]alternatively you can you:
import pymel.core as pm
pm.mel.warning("Dice!")
Working with Seth at the mo to get to the bottom of this.
~B)[/QUOTE]
Ditto this, unless your pymel.core.init is broken, any of these should work:
import pymel.core as pm
pm.warning
pm.mel.warning
pm.Mel.warning
pm.language.Mel.warning
So after some long digging by Seth and I we found out (facepalm) that maya 2009 doesn’t have a python call for warning and maya 2012 does.
So yeah, use the pm.mel.warning call.
~B)
Cheers for the investigation guys, I did default to the version…
pm.mel.warning('Dice')
Just wanted to confirm i wasn’t missing something.