Calculate the closest point on a triangle, by the point positions, using math and vector projection, with Python in Maya.
Calculate the barycentric weights for this point.
This method will allow you to use the barycentric weights from a point cloud or UV, or even a mesh.