Today we’ll be talking about projection painting in Blender. We’ll see how to paint a texture from a projection. I’ll be using the 2.90 version of Blender.
Here’s the video version of this article:
In this article we’ll be using the following image by Kevin Amrulloh from Pixabay:
Here we have an interesting Rubik’s cube. What interests us is the top face of the cube. Here we have a texture projected in a perspective that we want to extract from the image so that it’s in orthographic projection, so it should look as we were facing it and not viewing from an angle. Here are the steps to follow:
Table of Contents
Step 1 – Create a Blender File
Create a new Blender File and save it right away. You can use any file name you like. Delete the default cube, we’re not going to need it.
Step 2 – Set the Camera Background Image
As mentioned before, we’ll be using the image by Kevin Amrulloh from Pixabay. Let’s set it as the camera background image. To do this, select the camera (A) and go to camera view (Num 0). Then go to the Object Data tab (B) and check the Background Images box (C). Click Add Image (D) and select the aforementioned image (E):
Step 3 – Add a Plane
Now we’re going to add a plane and position it so that it covers the surface we want to extract the texture from. In our case it’s the top face. We will do it in camera view. So, hit Shift + A and select Mesh -> Plane (A) and then toggle the X-Ray button on (B) so that we can see through it:
Step 4 – Position the Plane
Go to edit mode and select the four vertices of the plane one by one and move them so that the plane outlines the top face of the cube:
Step 5 – Go to the UV Editing Workspace
With the plane still selected, go to the UV Editing workspace. In the 3D Viewport on the right go to camera view so that you can see the background image. Select all the vertices of the plane in the 3D Viewport.
Now, the top face of the cube, when viewed from the front, is a square, and so is the aspect ratio in the UV editor on the left. If it was a different shape, like a rectangle, you might want to adjust the aspect ratio so that it matches that of the original surface that you want to paint.
Step 6 – Add Another UV Map
We’ll need another UV map, so go to the UV Maps section (A) in the Object Data tab and add another UV map by hitting the plus sign (B). Rename it ‘projected’ (C). We will then draw from the ‘projected’ UV map onto the first UV map.
Step 7 – Project from View
While still in camera view, go to the UV menu and select Project from View:
Step 8 – Open the Cube Image
Now open the cube image in the UV editor by selecting it from the drop-down list. The UV map should overlap with the top face of the cube. If it does, you’re good to go:
Step 9 – Create a New Image
Now we’re ready to create the image that we want, so the front view of the texture which we now see in projected view on the top face of the cube. First, let’s go to the Texture Paint workspace (A) and set the Mode under Texture Slots to Single Image (B). Then press the New button to create a new image and name it ‘extracted’ (C) – this is going to be the image of the extracted texture:
Step 10 – Select the Original UV map
We want to use our original UV map for the painting, not the ‘projected’ one, so make sure to select it.
Step 11 – Select the Clone Tool
We will be using the clone brush to paint our texture, so select it from the tool bar. It works just like the clone tool in any graphical program, so you just set one cursor on the area that you want to copy and then you use the main cursor to actually clone the texture the first cursor is moving over:
Step 12 – Select Source Image and Source UV Map
In order to be able to clone the texture, you first have to enable the Clone from Paint Slot box (A). Then you have to set the source image to the image of the Rubik’s cube (B) and the source UV map to the ‘projected’ UV map (C), which is the one from which we will be cloning:
Step 13 – Clone the Texture
If you now hover your mouse cursor over the source image (A), the target image will be drawn (B):
Step 14 – Finish the Projection Painting
When you finish the painting, you will have the original projected texture in front view, so as if you were facing it. But you will notice that the target image is distorted. This is because it has to little geometry. Let’s add some geometry to get rid of the distortion.
Step 15 – Add Geometry
To add geometry, we must go to edit mode (A). Now, with the plane selected, let’s subdivide it. You can do it from the Edge menu (B). Set the number of cuts to 50 (C), this should do:
Step 16 – Paint Again
Now go back to texture paint mode (A) and paint again (B). This time there should be much less distortion (C). If you’re not yet fully satisfied, you can try a greater number of subdivisions, but generally we’re done.
You can now go to the Image menu and save the extracted texture.