I got the 2 point array handler from Mattias' Notes: float2 and float3 in Maya Python API and I can’t get a handle on why this isn’t working. From what I’ve been able to find it seems to be working for them fine.
In the same tool i’m getting mesh intersections with no issue at all it just seems that this one command is throwing me for a loop.
“argument 2” is referring to the hitPoint object, not the uvPoint. Since getUVAtPoint is a method of the meshFn class, the first argument will always be self, and the 2nd will be the first one you pass in.
Your error is because your hitPoint object isn’t an MPoint. How are you getting your hitPoint object?
Thanks for the quick reply capper. The hitPoint is an MFloatPoint and that portion has been working for a while now. Is an MPoint no longer an Mpoint after it has had a result fed into it?
hitPoint = OpenMaya.MFloatPoint()
The result of that meshFn.closestIntersection comes back as hitPoint.x,y,z just dandy. Maybe I’m not clear on the MPoint yet?
You are trying to pass an MFloatPoint to getUVAtPoint, but it is expecting an MPoint so it throws a type error. One of the constructors of an MPoint takes an MFloatPoint as a argument:
MPoint (const MFloatPoint &src)
Class constructor.
So after you fill your hitPoint with the intersection, call