| MStatus getClosestPoint | ( | const MPoint & | toThisPoint, |
| MPoint & | theClosestPoint, | ||
| MSpace::Space | space = MSpace::kObject, | ||
| int * | closestPolygon = NULL | ||
| ) | const |
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/56641ac5-2e10-41b1-940b-5b8edc16614c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi GrañaI tried, and fail too. The result is on mesh's surface, but clearly not the closest point :(
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMCvD%2BEazGE%2BFsSGfZiDZVjM5v3SZ-cFS9p%3D_bpQhzj8B5XS2Q%40mail.gmail.com.
First of all, it works, thanks a lots, and for telling me about python api 2 too :D
Just a little confuse about MSpace, i used MSpace::kObject, but lately,it got multiply with mesh's matrix, so they should be identical, right?
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMCvD%2BFOc2M9F5qoHaUW4zjMp91gqGM98-21FvAOA2XOd7DS9w%40mail.gmail.com.
mat = meshPath.inclusiveMatrix()resultPoint = om.MPoint()polyIntersect = om.MMeshIntersector()polyIntersect.create(shape, mat)ptON = om.MPointOnMesh()polyIntersect.getClosestPoint(pt, ptON);resultPoint = om.MPoint(ptON.getPoint().x, ptON.getPoint().y, ptON.getPoint().z)
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/EznnAtM0Hgw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/68f88735-8cb6-44db-8655-f93d7aff80a1%40googlegroups.com.
Thank Chad, it works beautifully :D
On Fri, Dec 5, 2014 at 6:40 AM, Chad Vernon <chadv...@gmail.com> wrote:
You're passing in the wrong matrix. You don't want the inverse you just want the inclusive matrix :mat = meshPath.inclusiveMatrix()resultPoint = om.MPoint()polyIntersect = om.MMeshIntersector()polyIntersect.create(shape, mat)ptON = om.MPointOnMesh()polyIntersect.getClosestPoint(pt, ptON);resultPoint = om.MPoint(ptON.getPoint().x, ptON.getPoint().y, ptON.getPoint().z)
On Thursday, December 4, 2014 12:56:20 PM UTC-8, illunara wrote:Hi ChadI attach the code using MMeshIntersector in the first post, but the result gone wrong :(
can you take a quick look at it please?
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/EznnAtM0Hgw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.