How can I transform XYZ locations into UV coordinates for a mesh? I have a mesh and a data that consists of temperatures at various XYZ values on the surface of the mesh (not vertex locations). I want to generate a texture of this data and apply it to the mesh.
I can call bpy.ops.uv.smart_project() on the mesh to generate UV coordinates for the mesh. What I haven't found is a way to map XYZ values into UV, or set a pixel value of a texture once I have the UV coordinates.