This is probably a question for you, keilun : )
I am referring to this thread :
http://forums.cgsociety.org/showthread.php?f=89&t=658510&highlight=groupId
I am facing the same problem as flaiver.
So, I created a ‘executeCommandOnIdle’, successfully created the groupId nodes and connected them to my node. In the next ‘compute’ cycle, them mesh was created and the face components ( for the shadingEngine ) were added.
But when I wanted to add the groupId with ‘MFnMeshData::addObjectGroup’, Maya tells me that the object does not exist.
I know it exists because I got the groupId data from the connected groupId node and the value is fine.
So, what did I forget to do?
here`s the code
for( unsigned i=0; i<faceIndicesInObjectGroupArr.size(); i++ )
{
MFnComponentListData polygonComponentListFn;
MObject polygonComponentData = polygonComponentListFn.create();
MFnSingleIndexedComponent singleIndexedComponentFn;
MObject polygonFacesM = singleIndexedComponentFn.create( MFn::kMeshPolygonComponent, &stat_ ); ME( stat_ );
ME( singleIndexedComponentFn.addElements( faceIndicesInObjectGroupArr[i] ) );
ME( meshDataFn.addObjectGroup( (unsigned)groupIdVec[i] ) ); -> error : object does not exist
thanks for your help!