PDA

View Full Version : Have you used subdivideFaces with success?


ThisIsMyName
04-11-2008, 06:28 PM
Hi there,
Ok, I'm not trying to spam the boards, but I posted this in the general maya forum and it was suggested that I post it here...

Anyway, my problem is that I'm calling subdivideFaces (vs2005, maya 8.5) and it seems like, although the surface is updated, the *number of faces* the mesh thinks it has never changes somehow.

Ok so after I do this:

MFnMesh meshFn( path ); //path is a MDagPath I've passed into the function
int numPolygons = meshFn.numPolygons();
MIntArray faceList( numPolygons );
for(int i=0; i<numPolygons; i++) {
faceList[i]=i;
}
meshFn.subdivideFaces(faceList,1);
meshFn.updateSurface();

I call this:

MItMeshPolygon faceIter( path );
cout << "numFaces after: " << faceIter.count() << endl;

and (on a cube that's been subdivided) it prints out 6. Meaning, it thinks that there are still only 6 faces (right?). The interesting thing is that when I actually iterate through it...

while(!faceIter.isDone()) {
MPointArray verts;
faceIter.getPoints( verts, MSpace::kWorld, &status) ;
//...some stuff that saves the face...
faceIter.next();
}

...the 6 faces it gives me have vertices that indicate they are part of the subdivided group. It's like, if I could just update the number of faces it *thinks* it has, it would work correctly. Thoughts?

Thanks for your help in advance!

CGTalk Moderation
04-11-2008, 06:28 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.