Ok, quick follow up:
First of all, this error only seems to occur if you have added a
dynamic compound attribute, and then looked at it in the attribute
editor.
Ie, if you execute this (taken straight from the maya docs):
http://pastebin.com/m2c019dfe
cmds.sphere( name='earth' )
cmds.addAttr( longName='sampson', numberOfChildren=5,
attributeType='compound' )
cmds.addAttr( longName='homeboy', attributeType='matrix',
parent='sampson' )
cmds.addAttr( longName='midge', attributeType='message',
parent='sampson' )
cmds.addAttr( longName='damien', attributeType='double',
parent='sampson' )
cmds.addAttr( longName='elizabeth', attributeType='double',
parent='sampson' )
cmds.addAttr( longName='sweetpea', attributeType='double',
parent='sampson' )
...then open up the attribute editor, and look at your pretty new
compound attribute (side note - 'homeboy' is displayed as 'sampson'.
Odd...), and THEN do:
cmds.addAttr(longName="msgAttr", attributeType="message")
...you'll get the annoying warning.
The second point is that I found a way around the warning, though it's
a huge hack - basically, just temporarily rebind AEreplaceCompound.
So, a function such as:
http://pastebin.com/m2a0ce632
def addMsgAttrNoWarning(node, attr, *args, **kwargs):
import maya.mel as mel
import maya.cmds as cmds
mel.eval(r'''
global proc AEreplaceCompound ( string $controlName, string $plugName,
string $changedCommand )
{
evalDeferred("source AEreplaceCompound");
}
''')
cmds.addAttr(node, longName=attr, attributeType="message",
*args, **kwargs)
... will avoid the warning. But it seems like such a potentially
messy solution, I think I'd rather just change my script to not use
compound attributes (they're not as useful as I'd hoped, anyway), and
hope the user doesn't add any themselves either.
- Paul