OpenMaya.MFnMessageAttribute()

93 views
Skip to first unread message

thirstydevil

unread,
Feb 16, 2010, 11:47:27 AM2/16/10
to python_inside_maya
I've created a basic MPxNode node that has nothing in it but some
static attributes

one of these attrs is a message array that I'm using to describe our
own metaData scenegraph. Basicaly a parent child relationship via the
connection direction. Everything is fine but I delete a node from the
connection the array isn't cleaned and a reference to the node is left
in the index. Am I using the right setting for this array. Or should
I override connectionMade() and do manual clean-up?

This how I'm declaring the attr

mAttr = OpenMaya.MFnMessageAttribute()
metaNode.metaLinks = mAttr.create( "metaLinks", "mLinks" )
mAttr.setArray(1)
mAttr.setConnectable(1)
mAttr.setStorable(1)
mAttr.setWritable(1)
metaNode.addAttribute( metaNode.metaLinks )

thirstydevil

unread,
Feb 16, 2010, 11:50:34 AM2/16/10
to python_inside_maya
Frak!

Tab committed the message...
Thanks for your help.

Kind Regards
David Moulder

Chad Vernon

unread,
Feb 16, 2010, 11:57:02 AM2/16/10
to python_in...@googlegroups.com
You have to do
mAttr.setDisconnectBehavior(OpenMaya.MFnAttribute.kDelete)


thirstydevil

unread,
Feb 16, 2010, 12:29:20 PM2/16/10
to python_inside_maya
Thanks Chad.
Simples...

Long hours and too much coffee...

-Dave

Reply all
Reply to author
Forward
0 new messages