Posted by The Reddest on 03/27/2008

8 comments
Skill

Blender Tutorial - Basic UV Mapping

Posted in:

I was going to write a tutorial about Photoshop's new 3D Layers, but I realized UV mapping was a pretty important part of using that feature. Therefore, I decided to first write a tutorial about basic UV mapping using Blender. Don't worry though, a tutorial about 3D Layers will come shortly after this one.

The version of Blender I used for this tutorial is 2.45. If you've never used Blender before, I'd recommend grabbing a copy and playing with it. I don't think it's the best 3D modeling tool in the world, but it's definitely the best free modeling tool in the world.

Blender Splash Screen

The object we're going to UV map today is the cube that comes with every new Blender project. If you simply open Blender, it automatically creates this cube for you.

Blender Default New File

The first thing we need to do is bring up the UV Image Editor. Usually we want this displayed at the same time as our cube. We can accomplish this by splitting the display area. To do this, right-mouse click on the top of the display area (where the resize cursor is visible) and selecting "Split Area".

Blender split menu

Once you split the display, you'll want to set one of them to display the UV Image Editor. I like the right side, but you can choose whatever side best works for you.

Blender display area menu

Once you've got the UV Image Editor displayed, it should look something like this:

Blender UV Image Editor

The first map we're going to create is the simplest - one image for all sides of the cube. To set this up we first need to switch the cube's display to the "UV Face Select" mode.

Face Select Menu

When you enter UV Face Select mode, you'll notice the display on the left turn blue. This represents all the faces on your UV map. You'll want to make sure all your faces are selected. You can do this by hitting the 'a' key on the cube display a couple of times. 'a' will select and deselect all items on your current display. When the faces are selected, the UV map will be blue, if nothing is selected, the display will be black.

Blank UV Map

Now that our UV map is set up, we can give it an image. I simply created a 512x512 square in Photoshop with a nice symmetrical design.

Sample Texture

Once your image is created (or you can use the one above), you simply open it using the UV Image Editor

Blender Open Image

When the image is opened, you'll immediately see the texture applied to your cube. I zoomed in a little and rotated the display (middle-mouse drag) to show it a little better.

Applied Texture

If you render this scene, you might notice your texture doesn't show up yet. That's because the material hasn't been told to use it. This is configured in the materials menu. The menu can be entered by pushing F5 or clicking the button pictured below.

Materials Button

Once you're in the menu, all you have to do is click the texface button.

Texface Button

If you render the scene now (F12), you'll see the texture in all its glory.

Rendered Scene

One image for all the sides of the cube is good and all, but usually I want a different image on each side. To do this, we're going to have to "unwrap" the sides of the cube onto our UV map. Unfortunately, Blender has no idea how to unwrap an object - even one as simple as a cube. We have to give it a little help by defining some seams.

Fortunately, seams are pretty easy to create. The first thing you'll want to do is switch to Edit Mode.

Edit Mode Menu

By default when you enter edit mode you're placed in vertex selection mode. You'll want to switch to edge selection mode since seams are created on edges. You can enter edge select mode by simply clicking the edge select mode button. Depending on how small your window is you might have to make it a little wider to see the button (like I did).

Edge Select Button

All of the edges will be selected when you enter edge select mode. Click 'a' to clear the selection. Now you'll want to select a set of edges and mark a seam. Edges can be selected by right-mouse clicking on the edge. Multiple edges can be selected by holding down shift and right-mouse clicking. Shift-right-mouse click all the edges that I've highlighted below.

Selected Edges

Once you have the edges selected, click ctrl-e to bring up the edge menu and mark the selected edges as a seam.

Edge Menu

You might be wondering why I chose those specific edges to mark as a seam. All I can say is that it's a pretty standard way to unwrap a cube (pictured below). If you stare at the edges long enough, you might be able to see how it unfolds into that shape.

Unwrapped Cube

After the seam has been created, switch back to face select mode and select all the faces on the cube. Then, on the UV Image Editor, unwrap the cube using the unwrap menu item.

Unwrap Menu

After the cube is unwrapped, the UV Image Editor should look something like this:

Unwrapped UV

Now you can draw a new texture and whatever is placed in each square will show up on each side of the cube. In order to draw in the correct spots, you'll probably want to save the UV layout and open it in another editor (like Photoshop). The layout can be saved by running the "Save UV Face Layout" script.

Save UV Layout

When you run the script, you'll be prompted for some options. Usually I'll only change the size depending on how high I want the quality (bigger size for higher quality).

Save Layout Options

When you save the layout, it will generate a black and white Targa that contains the outline of your UV map. Below is one I filled in with letters for each side of the cube.

Letter Texture

To use it, just open it into the UV Image Editor like we did for the first image. Now you've got a cube that looks like this:

Cube With Letters

And when it's rendered, it will look something like this:

Rendered Cube With Letters

That should do it for UV maps in Blender. The concepts introduced here can be expanded for any number of complex objects. I always thought Blender's learning curve was a bit steep, but hopefully this, and future tutorials, will help the climb. Keep an eye out for a tutorial about Photoshop's 3D layers, which makes drawing your textures easier than ever before.

Terrordar
07/09/2008 - 13:04

Thanks for the tutorial! Very good example

reply

Ray
08/19/2008 - 16:38

I want to do something similar, only I want to restrict the mapping to a specific area. For example, I have a 3D football helmet and I want to map a team logo to both sides of the helmet. How can I do it? And if there is a very easy way using some other software, I'd like to know about that too!

Thanks.

Ray

reply

Kadri
09/05/2008 - 17:57

thanks it will be so usefull for me
;)

reply

Jupi
10/16/2008 - 11:13

Thanks for the tutorial.
I did it in Blender 2.45 because in version 2.46, 2.47 I didnt find "UV face select".
Did I miss something in new versions? :)

reply

RCramiro
10/16/2008 - 12:17

This is a really good tutorial for intrudicing Blender newbies to UV mapping, & it really helped me.

Thanks!

reply

Simon
12/04/2008 - 11:22

In the new versions of Blender you must click in the edit mode on ctrl and tab and then on face select.
But very good tutorial!

reply

Anonymous~
03/20/2009 - 05:49

Thanks for the tutorial.

reply

Slydog349
04/21/2009 - 14:01

Coming from a programming background, textures (and therefore UV mapping) totally eluded me. I kept getting lost in the Materials / Texture settings and not getting any results. It was hard to find a VERY basic example. You could not have make it more clear. A huge Thank You!

I'm finding Blender easier to use each day, but only once you slowly learn each concept. I need a 'dummies' book badly!

reply

Add Comment

Put code snippets inside language tags:
[language] [/language]

Examples:
[javascript] [/javascript]
[actionscript] [/actionscript]
[csharp] [/csharp]

See here for supported languages.

Javascript must be enabled to submit anonymous comments - or you can login.