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

10 October 2010, 01:15 PM

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


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.


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

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

10 October 2010, 02: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 October 2010, 02: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.