getting a face index on a mesh from an int ptr

37 views
Skip to first unread message

Benjam901

unread,
Sep 27, 2016, 4:48:58 PM9/27/16
to Python Programming for Autodesk Maya
Hello all,

I am trying to get the face index of a mesh as you drag the mouse along it. I have found some code that has got me in the right direction.

However I am having trouble getting the face id. I am using a cmds.draggerContext and inside the onDrag function I have a fnMesh.closestIntersection call that is returning an int pointer as a result but I cannot figure out how to covert the pointer to an int i.e. the actual face id.

The code is below as a gist for you:


If there is a way to get the faceID or the Face straight out of the pointer that would also be awesome!

Cheers,

Ben

Benjam901

unread,
Sep 27, 2016, 5:13:16 PM9/27/16
to Python Programming for Autodesk Maya
Ah the programmers gaze,

As soon as I had posted I had found my answer :)

In case anyone else gets stuck with something like this: fId = om.MScriptUtil.getInt(hitFacePtr)

Cheers,

Ben
Reply all
Reply to author
Forward
0 new messages