In Max Script, if you want to create a group, you should have something to be inside the group first. i.e.
group something group selection
So far, I only know how to create an empty Group via Max SDK.
INode *child; Object *obj = (Object*)CreateInstance(HELPER_CLASS_ID, Class_ID(DUMMY_CLASS_ID,0)); IDerivedObject *dobj = CreateDerivedObject(obj); child = GetCOREInterface()->CreateObjectNode(dobj); child->SetName(some_name); // attach to another INode* parent->AttachChild(child); // attach another INode* to it child->AttachChild(grandChild);
Wait a minute. This creates a Dummy, not a Group! A Dummy is quite a different thing. It cannot be closed. It’s bounding box does not respond to stuff under it. If you delete a Dummy, stuff under it will still be there. OK, there is some trick: as long as you type:
It will be a Group! Also there is something I don’t understand: after an API mesh object (say grandChild) is created, I should attach it to an existing Group. Unless I call:
It will fail. I suggest that is due to a mesh object cannot be a group head. Just like only Transform node can have children in Maya. Because I want to put everything in the same hierarchical order as they are in Maya, a mesh cannot have any child should not bother me in this case.