Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Creating Container Node in Maya API C++?

Creating Container Node in Maya API C++?

Anonymous
Not applicable
460 Views
2 Replies
Message 1 of 3

Creating Container Node in Maya API C++?

Anonymous
Not applicable
I want to create a container node and add some nodes to it using Maya C++ API. I could not find anything related to containers in Maya document. Closest I got was MFnContainerNode which is a function set to work on container nodes, But how do I create one?

In Python I can do something like

maya.commands.container(name = "myContainer", addNode="some node 0", ihb=True)
maya.commands.container("myContainer", edit=True, addNode="some node 1" )


Is there an equivalent in Maya C++ API? If not, any workarounds?
461 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
import maya.OpenMaya as OpenMaya

fn = OpenMaya.MFnContainerNode()
fn.create("container", "testContainer")
0 Likes
Message 3 of 3

Anonymous
Not applicable
but how do I add nodes to this container?
0 Likes