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.

  • $\begingroup$ You might want to use vertex colors for that (see this answer). If that's an option, I suggest have a look into the specifications of a .ply file to write your own files with vertex colors and import them as usual. Otherwise please share some example files to play with. It's hard to help, based on your provided informations. $\endgroup$
    – p2or
    May 5 '18 at 13:41
  • $\begingroup$ The problem with vertex colors is that they require modifying the mesh. I can't afford a vertex per pixel. This is also not a 1-off for a video, but a visualization that will be rendered many times and ways. $\endgroup$
    – IRayTrace
    Feb 5 '19 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.