Hello Illunara, Haven't done this for a while, but i remember using from MFnMesh the getClosestPoint function instead, not sure if this is what you are after...
MStatus <http://docs.autodesk.com/MAYAUL/2013/ENU/Maya-API-Documentation/cpp_ref/class_m_status.html> getClosestPoint(const MPoint <http://docs.autodesk.com/MAYAUL/2013/ENU/Maya-API-Documentation/cpp_ref/class_m_point.html> & toThisPoint,MPoint <http://docs.autodesk.com/MAYAUL/2013/ENU/Maya-API-Documentation/cpp_ref/class_m_point.html> & theClosestPoint,MSpace::Space <http://docs.autodesk.com/MAYAUL/2013/ENU/Maya-API-Documentation/cpp_ref/class_m_space.html#ab11a1dda34491acff014ddfc9e6bafb8> space = MSpace::kObject,int * closestPolygon = NULL )const I cant find the code where i used it, I'll keep looking... Cheers, Eduardo On Thu, Dec 4, 2014 at 9:10 AM, illunara <[email protected]> wrote: > Hi everybody > Maya already had closestPointOnMesh node to do it, but i don't know how it > working from inside. Any chance to read the source of this node? > > Anyway, i try to write one using openMaya, but its not working either, > here is the code. Please tell me where it goes wrong. Thanks > > https://gist.github.com/illunara/4a456d1407f9f60a1089 > > -- > 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/56641ac5-2e10-41b1-940b-5b8edc16614c%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/56641ac5-2e10-41b1-940b-5b8edc16614c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Eduardo GraƱa www.eduardograna.com.ar -- 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/CACt6GrmGmY%2Bdzeao0RF64knLJsM7_Knr_6wgVP3Zja1j%2BfzLaw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
