Hi, Another one... I'm trying to query the UVs of a point returned by MFnMesh.getClosestPoint(). All works good, I get the point, initialize the iterator, set the index (tested it, its ok) than call the closestPoint and the code freaks out with:
# Error: invalid null reference in method 'MItMeshPolygon_getUVAtPoint', argument 3 of type 'float2 &' # Traceback (most recent call last): # File "<maya console>", line 1, in <module> # File "C:\engserv\rbuild\195\build\wrk\optim\runTime\Python\Lib\site-packages\maya\OpenMaya.py", line 6259, in getUVAtPoint # ValueError: invalid null reference in method 'MItMeshPolygon_getUVAtPoint', argument 3 of type 'float2 &' # This is the relevant part of the code: -- import maya.OpenMaya as OpenMaya MSUtil = OpenMaya.MScriptUtil() ... faceIter = OpenMaya.MItMeshPolygon(meshDagPath) dummyIndex = MSUtil.asIntPtr() faceIter.setIndex(hitFaceIndex, dummyIndex) uvPoint = MSUtil.asFloat2Ptr() faceIter.getUVAtPoint(closestPoint, uvPoint, 1, ""); -- Is the returned UV not a float2 data? Or am I doing something totally wrong? Any help is much appreciated! Cheers, Szabolcs -- http://groups.google.com/group/python_inside_maya
