« Distributing Maya Apps - Porthaton is around the corner | Main | Got it right in MEL »

September 11, 2013

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

chayan

Hello Cyrille,

Thanks for the great note.
As you briefly talked about Custom Node attributes here that made me curious about
if there is any way of listing all the plugs/attributes attached to a dependency graph node using API command.

eg: using MFnDependencyNode() we can access a particular plug if we know its name.

mFnDN = OpenMaya.MFnDependencyNode(mObj_node)
visibility_plug = mFnDN.findPlug("visibility")

In this case a single plug is accessed and we know its name.
Is there any command which can list all the plugs of a dependency graph node (if we don't know that names of all the plugs) ?


Thanks,
Chayan

Cyrille Fauvel

Hi Chayan,

yes, you can list plugs using: MFnDependencyNode::attributeCount() / MFnDependencyNode::attribute()

but in case you want the connected plugs, you will need: MFnDependencyNode::getConnections()

Plugs on a node found in this way can come and go based on a number of internal optimization reasons so the list you are asking for is not necessarily going to be consistent each time you ask.

Hope that helps,
-cyrille

The comments to this entry are closed.

Cyrille Fauvel

SyntaxHighlighter