
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello.
I want to create an objectSet in a node in maya 2016.
A possible node superclass seems to be MPxObjectSet, but i found absolutely no documentation how to initialize the dagSetMembers Attribute, which seems not to be initialized by the superclass (which doesn't have an own initialize method). I tried some possibilities, where most of them just crashed maya.
Then i just thought i can create a node, which has an output plug, which can be connected to objectSet.dagSetMembers (or the corresponding plug on a shape node, where the set node i connected to).
My current try looks like this:
objGroupComponentsListAttr = tAttr.create("objectGrpCompList", "gcl", MFnData::kComponentList, &status); tAttr.setWritable(false); MObject objGroupId = nAttr.create("objectGroupId", "gid", MFnNumericData::kLong, 0); MObject objGroupColor = nAttr.create("objectGrpColor", "gco", MFnNumericData::kShort, -1); dagSetMembersAttr = cAttr.create("dagSetMembers", "dsm", &status); cAttr.setWritable(false); cAttr.addChild(objGroupComponentsListAttr); cAttr.addChild(objGroupId); cAttr.addChild(objGroupColor);
the objGrpCompList output contains after the node computation edges like "e[0:11]" and looks just like the shape.instObjGroups[0].objectGroups[0].objGrpCompList plug in the outliner, which has a tooltip with "e[0:11]" as well, if i create a corresponding set via create->Sets->Set menu.
I cannot connect the objGripCompList directly (as it is not connectable on the Shape node), but i can connect the objectGroup plug.
Then i first connect a groupId node to the objGroupId plug in my generator node, then i try to connect either the generator node to the objectSet node or try to connect it to the shape node and connect the shape node to the objectSet node.
I did not find any connection, which made the edges appear in the set in the outliner. I am not 100% sure if i got all attributes right. I think especially the generic attribute in the objectSet probably accepts even wrong connections.
Solved! Go to Solution.