Tutorial and explanation at this link: http://www.andreageremia.it/tutorial_uvrender.html
Extracting the UVs of your mesh and use them in your script is one of the main task you have to do with 3D world. So I decided to create this tool. Nothing complex, just it can be useful to speed up your work.
This tool needs 3 inputs: camera, 3D object and image, but the last one is not always necessary
There are 4 operations you can do:
1. Projection from Camera
You can project the image connected from the camera to the 3D Object. There are the extra options of FrameHold for the Output image and the Camera
In the second operation, you can visualize immediately the Wireframe. Use the Parameters to tweak the output image
3. UV Map
In this case I'm going to use an UVMap on the mesh. We have a red-gradient from right to left and a green-gradient from top to bottom
4. Image as Texture
Use the image directly on the UV, without projection or any other operation
Please login in order to download these files.