PDA

View Full Version : Problem with getConnectedFaces()


Panca
03-11-2012, 04:23 PM
Hi, everybody.

I trying to write my first node in python.
I need to find the N vertice around each vertex. So I though using the getConnectedFaces function to find the faces and then convert the faces to vertice.

I don't know how to initiate the MItMeshVertex. All the exemple I found on the internet are based on user selection. I need to use the inMesh connection with is the input of my node.

Here is my code so far
Thank you very much for your help

P.

-------------------

def getClosestPoint(mFnMesh):
meshMDagPath = mFnMesh.dagPath() # return MDagPath object

inMeshMItMeshVertex = OpenMaya.MItMeshVertex(meshMDagPath)

# Get the faces connected to the vertex
connectedFacesIndices = OpenMaya.MIntArray()
inMeshMItMeshVertex.getConnectedFaces(connectedFacesIndices)

return(connectedFacesIndices)

CGTalk Moderation
03-11-2012, 04:23 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.