Unwrapping Suzanne

Relevant to Blender 2.34

by Claudio 'Malefico' Andaur

When dealing with complex models like characters, the need for more powerful tools becomes apparent. From Blender 2.34 several new tools have been incorporated into the Blender source code, like Seams and the LSCM unwrapping method.

In this tutorial, I'm going to fully unwrap Suzanne to show you how to use these new tools.

Easy as it "seams"

A mesh can be organized with the use of seams which provide a nice way to create "Face Groups" prior to doing an unwrap. These "groups" are just a way to call a selection of faces, and not a separate entity like Vertex Groups are. Seams are created by selecting a loop of vertices in Edit Mode and pressing CTRL-E or, using the menus, by selecting Edge Menu->Mark Seam. A thick continuous line will be drawn in the 3D window showing the newly created Seam. It is possible to visualize this seam both in Edit Mode and in Face Select Mode activating the Draw Seams option in the Edit buttons.

Once a seam is marked, we can select each side of the model in Face Select Mode, by selecting first a face, and then pressing the LKEY. All connected faces that are isolated from the rest by this seam will be selected. By strategically creating seams in our model, we will be able to work later on with this group of faces only, thus greatly simplifying our job.

Ideally we should mark a seam wherever we want the UV map to have "cuts". For instance to isolate the legs and arms of character from its torso.

Let's do some real work. Add a Suzanne to our scene, and select the vertical central loop of vertices, be sure to completely select it. Press CTRL-E to mark this loop as a seam. Let's test it, enter Face Select Mode, we should see the seam. Select a face, and the press LKEY, all faces from this side should have been selected. Had the whole model been selected instead, this would mean that we have missed some vertices from the central loop, if this is the case please go and select the missing vertices. Easy, right? That's the idea.

Figure 44. Suzanne with marked seams.

Create some more seams, try to isolate complex zones from each other, like the ears from the head. When we unwrap it, these seams will act as cuts in the surface and also in the UV map.

An interesting loop to add a seam to is the main face loop of Suzanne, so we can separate the front side from the back.

Unwrapping the mesh

Open a UV Editor window besides the 3D viewport. Now select the model and enter Face Select Mode.

Select the faces in the left and right side of Suzanne's scalp including the ears. We are going to unwrap these groups using the Sphere option which will give us a nice starting point for LSCM later on. It is very likely you'll get something "almost" perfect. However I always get a couple of faces in the wrong side of the map. This can be fixed easily by hand, but I'm such a lazy guy that I will not do anything at all. Press CKEY in the UV Editor to enter Face Selection Mode (this one is a nice one). Select some of the faces around the ears, just the ones that look radially unwrapped. Leave this mode and select the vertices in the upper central zone. The ones in the central lower part are a bit tricky. We will do them in a while. Now, with these vertices selected, press PKEY. This is the Pin command. It will fix the locations of the selected vertices so nothing can damage our layout. More on this later.

Figure 45. Pinning UVs.

Now that we have pinned the nicely unwrapped vertices, unselect everything in the 3D window but the two faces in the chin. In the UV Editor, pin the central two vertices of these faces that were unaccessible previously. We are almost done.

Figure 46. Accessing occluded UVs.

Now it's time for some LSCM magic. In the 3D window select all faces linked to the ones in the chin, (use LKEY, remember?). You should not select the ears this time. The selected faces should appear like a map in the UV Editor. Now select all vertices in the UV Editor and press EKEY. Blender will ask about doing LSCM. Accept the query. Wonderful things will happen. Suddenly, the "unpinned" faces will be relocated to a nicer location, overlapping of faces is magically fixed. Cameron Diaz is on the phone.

If you select the ear faces in the 3D window, you will see they are still there, don't worry about them right now.

Now we should make some space in the map for the front faces. We can do this by selecting the border vertices and scaling them. The UV Editor supports the Proportional Editing Tool (OKEY) just like meshes. It is very useful for making some space here without overlapping faces.

Figure 47. LSCM in action.

Once we have made some space, select the front faces, set the viewport to the front view, and mapped the faces using the "From Window" option. Scale them down a bit in Y or X so they fit in the space we have reserved for them in the map. Just press SKEY followed by YKEY or XKEY like you would do with meshes.

We now have the front faces nicely unwrapped in the UV Editor.

Figure 48. Front group mapped "From Window".

Figure 49. Two islands in the map.

If we unselect the currently selected faces in the 3D window, we will not be able to see them anymore in the UV Editor, but you can activate the Draw Shadow Mesh option in the UV Editor's View menu to help you visualize the unselected faces.

"Stitching the Map"

Now we need to join these two "islands". If you keep CTRL pressed while selecting a vertex, all concurrent vertices will be selected too. This can be toggled on with the Stick UVs to Mesh Vertex option in the Select menu of the UV Editor. Select a vertex from the border, you will see its homologue in the other island selected too. "Stitch" them together by pressing VKEY. They will merge into a vertex located at the middle of the original ones.

Figure 50. Stitching.

Now, it might be a little tedious to continue vertex by vertex. Select all vertices in the border of Suzanne's face. Now stitch. Pin the selected vertices. Remember to pin only if there are no overlaps. If after a stitch, there are overlapping faces, keep stitching the rest and do not pin the stitched vertex.

Figure 51. Stitching.

Now we have both islands stitched. However there are zones where faces are overlapped. Be sure to have pinned the "nice" vertices and do some LSCM again. Select all vertices and press EKEY. If you do well, each LSCM step will fix vertices located at overlapping faces, that you should pin to "keep".

Feel free to scale or move the vertices before doing an LSCM calculation but always select pairs to keep the symmetry controlled.

"Solving the Ears"

Now we are going to use the same methods explained before, to fix all overlapping faces in Suzanne's ears. It's better if you work each side separately.

First, select vertices in the border area, where the ear should join the rest of the head. Just as we did before, select in pairs and stitch. Pin everytime you stitch, now pin those vertices nearby the stitching that are not overlapped. Select ONLY the vertices of the ear we are working on, and do an LSCM step.

Now, stitch again the vertices in the border area of the newly generated "island". Again, pin after stitching and also pin the following row of non-overlapping vertices. Do some more LSCM. Proceeding this way, we will get an almost completely pinned ear, with no overlapping whatsoever.

Figure 52. Unwrapping the ears with LSCM.

You can do this manually, by selecting vertices with CTRL pressed and then moving them away but it is harder and more boring. Besides, the LSCM method gives us an optimized map in order to avoid stretching in the textures.

There is not too much work left to do. We can select the eyes face groups and map them 'From Window' or LSCM. Since the eye meshes are not linked to the rest of the mesh, the Stitch command will not work. If you want to merge the eyes with the rest of the face you will have to do it with the Weld command (WKEY) instead. However, I prefer having them aside, so when painting the texture I can give some extra detail to the eyes more comfortably.

Figure 53. Stitching.

If your character has eyelids, it is advisable to uvmap them almost closed in order to have a nice surface to paint the texture later on.

What now?

Once we have completed the unwrapping, we can export it using the Save UV Layout option in the menu, which will launch a Python script included with the Official Blender Release. There you have to set the Image size (remember that the UV layout is a square image) and set a proper name to it. It will save a TGA image of your UV map which you can load into the Gimp, Photoshop or any other software, as a reference layer for painting your texture.

Figure 54. Final exported UV layout.

To be able to use this UV map as a reference, your 2D software must be able to manage transparent layers. In my case I chose the Gimp since I work on a Linux box, but you can use whatever you find suitable.

Create a new image, same size as the UV map, and load the map into one layer. Add a few more layers on top of the map layer. I have created three layers, named COLOR, BUMP and SPEC-REF. These will generate three different images which I will use as separate texture maps for Col, Nor and Ref/Spec channels in my Blender material. However you might want to use a unique texture map for everything. The good thing about using several textures is that you can for instance tweak the Bumping of your material without altering the Colour work.

Figure 55. Gimp is a 2D app that supports transparent layers.

I have switched every layer off except for the layer I'm working on, and the UV map layer. You must reduce the opacity of the working layer so you can have a view of the UV map all the time.

Figure 56. Using the UV map as reference for texture maps.

The colour map doesn't have too many mysteries. These colours will be mapped over the model exactly as they look. The SPEC-REF and BUMP textures are a little more sophisticated. Everything in white will appear "more reflective" - that is lighter, in the first case, or "bumpy" in the second case. The black areas on the contrary will look darker or flatter respectively.

Figure 57. The three texture maps.

You can generate as many texture maps as channels you have available in Blender, counting Raytraced Mirroring, Translucency, Emit, Specularity, etc. All these texture maps will share the same UV map as long as you indicate it so using the UV option in the Texture Coordinate Input panel in the material buttons.

To use these texture maps we have created, we need first to create a material, and then the required Image textures. Take care in activating the UV option for every texture map, and applying to the intended texture channel. If you use the Colour map for Bump, it will look a little weird. You can mix a material colour with the Colour map if you feel it needs it. Just slide down the Col slider for that texture.

You only need to load the texture map in the UV Editor if you want to tweak the map based on the how the texture looks, or if you want to do some extra paint on it using the texture painting tools. Otherwise it's not really needed to get your render done.

Figure 58. Adjusting the colour texture map.

Well, there is no much left to say about UV texturing. In the rendered example I have used two materials with almost the same settings for the head and the eyes. I have used a non-zero value for Emit in the eyes, but everything else is the same. You can tweak the UV map, so the texture map fits better if you need it.

See you and keep blending!

Figure 59. Final render. Really ugly textures... I should paint them again...