the almost complete idiots guide to uv mapping in …dipmm.pbworks.com/f/uv_tutorial.pdf · the...

17
The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ UV Mapping in a can.” 0>=----------------=^=----------------=<0 By Phantomgraph };8>

Upload: haphuc

Post on 14-Mar-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+

“UV Mapping in a can.”

0>=----------------=^=----------------=<0

By Phantomgraph };8>

Page 2: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Introduction

I hope the title of this little tutorial doesn't put too many folks off, but as I spent many an hour fuddling over other

UV tutorials out there for Blender I decided to make one that was step by step just in case someone out there is

having trouble like I was. This tutorial may seem overly verbose, but I find that explaining all the steps

sometimes helps folks find tricks and tips that may not seem obvious to the student. };8>

This tutorial was designed using Blender 2.42 on a Linux machine. It should work fine on the Mac and Windows

versions as well, less the file naming convention differences of course. You will also need some kind of image

manipulation program (I.E. Gimp or Photoshop) to actually make the textures for any kind of production use,

although you can use the built in paint tools to do the trick for objects that don't need that 'perfect' look.

I will not be delving into the actual drawing of the texture map, I'll leave that up to the experts in the art

department, but I will include some helpful hints on how to create blank and template UV textures for later

modification.

I am assuming that you know enough about Blender to be able to model objects, select vertices and so on, but

otherwise this tutorial assumes this is the first thing you have ever tried to UV texture.

Are we ready? Good! Lets get started!

Part I - Setting up the scene

Page 3: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

The process of creating a UV map is something akin to taking a 3D object and cutting it up so that it lays flat. For

this tutorial we are going to make a tin can because it's easy to visualize how to cut it apart.

Start Blender with a new scene and delete the default cube. (Press X, then Enter) Make sure you're in top down

view by pressing the 7 Key on the number pad and add a cylinder by pressing space and under the 'mesh' menu

that appears select 'Cylinder'. Blender will prompt you for the number of vertices which defaults to 32. Change

the number to 16 and click OK . The final product will look a little rough, but it will do for our tutorial here.

While still in Edit mode press F9 to switch the panel over to the editing buttons and click the 'Set Smooth' button

in 'Link and Materials' This will make our can nice and smooth.

Now press Tab to exit editing mode and select the lamp by clicking on it. (You may have to zoom out to see it)

Press G and move the lamp over next to the camera. When you are finished you should have something that

looks like figure 1. If you want do a quick render, press F12. You should see a new window pop up that looks like

figure 2.

Figure 1 – Our scene (in 3D window) Figure 2 – A quick Render of the scene

Part II – Seaming

Page 4: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

The next step is to determine how to cut a object up so that it will lay as flat as possible. Of course a complex 3D

object such as a human head has way too many variables to be able to truly make it flat, so a compromise has

to be reached. The general idea is to cut the object up in ways that allow similar parts to have as few seams as

possible. One can sometimes look at articles of clothing or packing boxes as a reference for where seams

should be. In the case of a human head it would probably be best not to divide the face with seam, choosing the

less conspicuous parts of the head (Such as the hair line) so that you're texture maps don't end up showing the

seams we are about to make.

For our example, A tin can, the choice should be immediately obvious. The top and the bottom will flatten out,

and if we cut the cylinder along vertically, it will lay flat as well. We always want to put our seams in the least

obvious places possible (Such as along sharp edges). This assists in blending the cuts smoothly to make a more

realistic object.

We want to reselect the Cylinder object and switch the 3D view to the back of the can so press <shift> 1 (The 1

on the number pad) Zoom back in on the can and press the Tab key to enter Edit mode.

By default all the vertices will be selected. Press the A key to unselected them. We now want to enter Edge

Select mode so press Ctrl, Tab then 2 or click the edge mode button on the 3D window's tool bar. (Fig 3) You

may want to click the 'Limit Selection to Visible' button as well for this next step. (Fig 3) I like to think of this

button as the block, (as in the icon) as it blocks you from selecting vertices, faces and edges that would not be

visible if the object were real and solid.

Figure 3 – 3D View Tool Bar

Page 5: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Now we want to select the center edge that runs down the back of the can. As we are already looking at the rear

of the can, we should select the center vertical edge. With the edge selected press Ctrl E to bring up the edge

specials menu and select 'Mark Seam' from the menu. Depending on you're Blender settings you should see the

edge change color to indicate that the seam has been marked. (Fig 4)

Figure 4 – Back of the can seam

Now we are going to mark the seam for the bottom of the can. Press A to clear all selected edges. (Note the

seam is still visible). If you activated the 'block' button deselect it now and using the bounding box tool select the

entire bottom of the can. Press B and box in the whole lower edge of the can. Now press the 2 on the number

pad to tilt the can up slightly so we can see the faces on the bottom. (Fig 5)

Page 6: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Figure 5 – The bottom of the can selected.

To make things simple we now need to switch to vertex select mode (The button to the immediate left of the

edge select in Fig 3 or press Ctrl Tab 1) and while holding down the Shift key click the center vertex of the can's

lid. When you're finished you should see something like what's in Fig 6.

Page 7: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Figure 6 – The outer ring of the can selected Figure 7 – The edges selected for the bottom seam

Go back to edge select mode (Fig 3), and this time unselect the edge of the bottom of the can to the immediate

right of the vertical seam. (You will see why later.) When you are ready you should see something like Fig 7.

Press Ctrl E and select 'Mark Seam' from the menu to mark the seam. Note how the seam is now indicated in a

different color. Press A to unselect all elements.

Now we are going to work on the top of the can. The first thing we need to do is switch our view to the front

center of the can by pressing 1 on the number pad. Now we repeat the steps of border selecting the top part of

the can, tip the can up with the 8 on the number pad, switch to vertex mode, unselected the center vertex.

Switch back to edge mode.

We are going to unselect one edge from the top of the can like we did on the bottom. To make life easier choose

the edge to the immediate right of the center of the can. Press Ctrl E and again select 'Mark Seam” from the

menu then press A to unselect all elements. When you're finished you should see something like Fig 8.

Page 8: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Figure 8 – Our can with all the seams marked

Part III – Building the UV Map

Now we are going to create the UV map that Blender will use to paint a texture on the can. The map itself is

internal to blender and is not an image, but we will make a visual representation of the map using some script

tools Blender has so we can paint a nice texture for our can.

The first step is to split the main 3D screen into two parts. (Hover you're mouse over the top edge of the 3D view

until the Up Down cursor appears. Right mouse click and select 'Split Area' from the menu that appears. A

vertical line will appear. Click in the middle of the screen to divide it into two 3D views.

Float the mouse In the right hand view and select UV/image Editor from the window type options. (Fig 9) You

should end up with something that looks like Fig 10.

Page 9: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Figure 9 – View selector Fig 10 – Blender with 3D and UV/Image editor

Now we move over to the left hand view, press Tab to go back to 'Object Mode', then Alt F to switch to the 'UV

Face Select' editor or choose the mode from the mode tool bar menu. (Fig 11) In the UV Face Select window

press A to select all faces. You may notice the UV window changes slightly. Press Ctrl E and select 'Mark

Boarder Seam from the Seams menu. (Fig 12)

Page 10: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Fig 11 – Mode Menu Fig 12 – Marking the Seams for the UV

Now we are going to create the UV Map. While still in the UV Face Select window press U and select 'Unwrap'

from the 'UV Calculation Menu'.(Fig 13) If everything worked correctly you should see the UV/Image editor

Window update with something that looks like Fig 14.

Figure 13 – The UV Calculation Menu Figure 14 – The UV Map

Now I'm going to take a moment to explain what we are seeing and why. }:8>

Obviously the two circles are the tops and the bottom of the can, and the strip between them is the face where

the label would go. But what's what? What direction is up?

Page 11: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

This is the reason we didn't create complete seams around the top and bottom. If you recall, we didn't make a

seam on one edge of the bottom of the can right at the back seam. Likewise when we worked on the top, we left

a single edge connecting the top to the label or front. Because the connection of the top will be in the middle of

the label we can look at the map and instantly tell which direction is which. Similarly we can tell the exact

orientation of the lids to the label for placing price tags and such. {Tricky eah? }:8>

Although we can not always cut an object to lay perfectly flat with no overlapping parts we can sometimes leave

a single edge connected to another part to help our minds visualize exactly where on the object the texture will

appear. In the case of our can, just by looking at the map we can tell what side is the top and it's exact

orientation to the label.

Remember if you make a mistake in making the seams you can always go back and try other formats. The UV

mapper will store the previous map, but once you're finished with you're seam changes you can always switch

back to the UV Face select mode, and select 'Reset' from the UV Calculation Menu. (Fig 13) You can then mark

the boarder seams again (Fig 12) and Unwrap the Object again. (Fig 13)

Part IV – Building a 'Default' texture map and painting the texture.

Now that we have the UV map set up in Blender, we can build the texture for Blender to 'wrap' on the faces of

the object. We are going to use a nice little script that ships with Blender to automatically create a rough texture.

First move over to the UV/Image Editor window. and click on the UV Menu from the tool bar. Select 'Scripts'

from the top and then the “Save UV Face Layout” script. (Fig 15)

Page 12: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Figure 15 – The UV Script Menu

A prompt box will appear (Fig 16) for our example we can use a size of 1024. For more complex objects you

might want to use a larger figure as this will be the resolution of the texture. Click the OK button.

Now one of you're view windows will change to a file browser. (On mine it's the bottom one) Save you're file

someplace. it should be a .tga file type. If we take a look at the content of the file we'll see something like Fig 17.

A couple of things I've noticed and some hints and tips:

1. For some reason on my Linux box using the save UV face layout script creates a .tga file that appears to

be corrupt. Opening it with Gimp and saving it again repairs this issue.

2. I usually always keep the .tga files that the script generates. This way if I want to change texture

sometime in the future I can always reload this blank 'default' to make a new file. This is helpful if you

end up 'recycling' an object in other blend files or projects.

3. You don't have to use a .tga file types for textures. Just about any file format you're computer supports

Page 13: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

will probably work, including Jpeg }:8>

Figure 16 – The Script Prompt Box  Figure 17 – Contents of the Texture file.

Part V – Setting the texture up and Rendering.

For this part I've taken the liberty of creating a texture for our can using Gimp. (Fig 18) Please don't laugh too

hard at the example. };8> I've saved the file as can_texture.jpg in the same directory as I saved my .blend file.

Now we are going to apply the texture so that it renders correctly and gives us a nice preview when we use

textured shading in the 3D window.

Page 14: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Figure 18 – The completed texture file

First lets set up our texture for the 3D window.

While in the UV/Image editor, click the 'Image' menu and select open from the menu and open our file. (Fig 19)

BOOM! You should be seeing the file in the UV/Image editor and wrapped around our can in the UV Face select

window! (Fig 20) In the UV Face select window you can move you're view around to make sure the price tag and

expiration date is on the top, and the made in Blender stamp is on the bottom.

Figure 19 – The open image menu Figure 20 – Blender with the texture applied

Page 15: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Now you might think we are done, but not quite. We have to add the texture to the object for the render engine.

First lets clean up a little. Right click on the dividing line between the UV Face select and the UV/Image Editor.

Select 'Join Area' from the menu that appears. Now float over the UV/Image editor half. You'll probably notice

part of the window dimming with a large arrow indicating that the UV Face Select window will slide over. Click

the UV/Image editor window to close it.

Now in the 3D window press Tab to switch back to Edit mode. (Fig 11) Now select the Shading button in the

buttons window or press F5 (Fig 21). A new panel will open called 'Links and Pipeline' Click the 'Add New' button

to add a new material to our can.

Figure 21 ­  Shading and Pipeline Buttons Figure 22 – Add New Texture 

A variety of panels should appear. Find the one labeled Texture and click the 'Add New' button. (Fig 22) A new

Texture will appear named “Tex” in the top button and two more tabs will appear on the panel. Move to the 'Map

Input' tab and enable UV mapping. (Fig 23) then switch over to the 'Texture' panels by pressing F6 or by clicking

the icon on the menu bar. (Fig 21)

Page 16: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Figure 23 – Map texture to the UV map Figure 24 – Define the Texture as a Image

Change the texture type to 'Image' from the list (Fig 24) and click the 'load' button on the panel that appears. (Fig

25) Blenders File navigator will appear and select our texture file. A thumbnail will appear in the preview panel if

it's open.

Page 17: The Almost Complete Idiots Guide to UV Mapping in …dipmm.pbworks.com/f/UV_Tutorial.pdf · The Almost Complete Idiots Guide to UV Mapping in Blender 2.42+ ... This tutorial may seem

Figure 25 – Load Image for Texture

Now all their is left to do is render, so mash the F12 key! Although I added a few more lights to our scene and

tweaked the camera angle you should see something like Fig 26.

Happy Mapping!

Phantomgraph }:8>

Figure 26 – The Final Render