Hi,

You can use MItMeshPolygon and it's method getConnectedFaces to obtain
connected polygon id's for each vertex.

For example:

import maya.OpenMaya as OpenMaya

mSelectionList = OpenMaya.MSelectionList()
OpenMaya.MGlobal.getActiveSelectionList(mSelectionList)
mObject = OpenMaya.MObject()
mSelectionList.getDependNode(0, mObject)
polyIterator = OpenMaya.MItMeshPolygon(mObject)
while not polyIterator.isDone():
            polygonArray = OpenMaya.MIntArray()
            polyIterator.getConnectedFaces(polygonArray)
            # do something with polygonArray
            polyIterator.next()


The code is just an example of the top of my head. I can't actually check
if it works since I don't have access to Maya at the moment :)

Cheers,
Risto




On Tue, Aug 5, 2014 at 3:54 AM, Bay <[email protected]> wrote:

> Hi,
>     I'm attempting to write a tool that allows me to attach and align an
> object according to a vertex normal. So far I've gotten it to work well on
> meshes that are higher res (as shown in the screenshot) but on lower res
> meshes I run into the problem where a single vertex has multiple normals,
> each the same as the vertex's adjacent polygons.  How would I obtain the
> IDs of the faces that are connected to this vertex? Any assistance is much
> appreciated.
>
>
>
> <https://lh5.googleusercontent.com/-Y6PfEu4Y3Ec/U-Am-G_8ANI/AAAAAAAAASk/lkfRouIjFjw/s1600/Screen+Shot+2014-08-04+at+5.16.21+PM.png>
> Thank you
> Gann Boon Bay
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/17296e41-ba80-485c-bbc8-d0f50db8cc73%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/17296e41-ba80-485c-bbc8-d0f50db8cc73%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CA%2B5uDBYqFzMFqvE180D0BU9cvwuv_FyyW6gCgQqAaNK3KZXUQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to