PDA

View Full Version : Define a hole in a polygon with MFnMesh


ErikJohEve
10-04-2010, 02:15 PM
Hi

I wonder how to define a hole in a polygon when creating a mesh with

MFnMesh::create()

If creating a face with MEL (polyCreateFacet or polyAppend) you can use the -hl option to specify which points that makes up the hole but i can not find any way to do this with the C++ API.

//Regards
Erik


From the help file there is:

"The faces of a polygonal mesh are stored in an integer array. Each face is described by a number of sequences of integers—each integer representing an edge id. The first sequence of edges represents the boundary of the face. Any subsequent sequences represent holes in the face. Internal flags mark the start and end of each sequence as well as the end of the face description are marked by internal flags. "

But no info on how to specify those flags.

If using python together with polyCreateFacet the flag is specified as an empty point():

cmds.polyCreateFacet( p=[(0, 0, 0), (10, 0, 0), (10, 10, 0), (0, 10, 0), (), (4, 2, 0), (5, 4, 0), (6, 2, 0), (), (5, 6, 0), (4, 8, 0), (6, 8, 0)] )

but i have no idea how to setup the vertexarray, polycount and polyconnect arrays for the MFnMesh in a similiar fashion. If it even works....'

I tried
polygonCounts.append(4);
polygonCounts.append(0);
polygonCounts.append(3);

which would make kinda sense but it only created two seperate polygons.

ErikJohEve
10-14-2010, 03:44 PM
I still have not had any luck creating the damn holes. Is it really not possible? I tried creating the holes as polygons to later inflict polyMergeFacet mel command but it made Maya crash.

I have all info that should be needed. The faces ordered vertices and the holes ordered vertices. This should not be so hard to do one might think.

CGTalk Moderation
10-14-2010, 03:44 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.