So I went through and did some formatting. Cleared up some confusing sentences, and probablly confused some others in the process. I've decided that I'm going to do a bit of color coding; Any button combos are Green
. Commands in GIMP are Blue.
Tell me if it helps.
I've also added a chunk at the end, which I thought needed mentioning but I've avoided in the main bloc. Read it and tell me what you think.
First, when you're making a UV map, there are four basic steps. You Unwrap
the model, Arrange
the map, Paint
the image, and Apply
Basically, what you're doing when you unwrap an object, is making a 2D representation of the surface. For example, if you unwrap a cube, you are going to end up with six squares; one for each face of the cube. This gets more complicated as your shapes get more complicated, but the basic idea is the same; it's as if you're cutting the surface off of your 3D object, and unwrapping it and flattening it out.
Because you are flattening out the surface, some of the faces are going to need stretching/squashing in order to give you a flat representation. It's like if you peel an orange; the peels stay curved, unless you press them. You could
get past this, because each individual triangle is actually flat, but then you would have trouble painting it because of how fragmented your map is.
So what we do, is try and cut the mesh up in such a way as to minimize distortion, but maximize area. How you do this varies a lot, by the shape of your mesh and personal preference.
But how do you actually do this in Blender? Well, you have a few options. First off is the traditional "Mark Seams"/"unwrap" combination. This is fairly straightforward. You select edges and hit Ctrl-E
, and select Mark Seam from the dropdown menu. Once you've marked some seams, you select the faces you want unwrapped, and hit U
, and select the first option. this creates a UV map, and unwraps those faces to it. The map is cut into "islands" along the seams you've specified, and, as far as I can tell, arranged fairly arbitrarily.
The UV/Image editor, and where to find it...
One tool that works well in connection with this is the "pin" command. This is used on selected vertices with the button "P
", in the UV/image editor. Any vertices you pin should be immune to later unwraps. So if you have one section lain out nice, but want to re-unwrap another section, you can pin the good section and go ahead with your unwrap, which can be done from the UV/image editor with the shortcut "E".
Pin doesn't always seem to work as advertised, though; I've had mixed results. One thing to note is that you can still edit pinned vertices normally, just not unwrap them.
When Blender flattens a mesh, it keeps the edges of the islands (groups of UV faces) constant, but arranges the vertices inside so as to minimize distortion. This seems to work fairly well.
But there are two other options for UV unwrapping that I thought I'd mention; "project from view", and "Unwrap (smart projection)". Both of these show up in the unwrapping menu, when you hit "U".
The first one of these is fairly simple; what it does, is tells blender "I want you to flatten these faces along the axis I'm looking along." I don't really know how to illustrate this one. Fiddle with it a bit. (maybe one of you guys can think of an example?)
The last one is probably the "best", distortionwise, but also the hardest to use on organics, or curved mesh. What Unwrap (smart Projection) does, is try and minimize distortion by evaluating each face based on it's angles related to other faces. You specify some guidelines, and it decides whether it can get away with squashing it, or if it needs to cut it up into another island. It will also follow your seams, but will also add it's own cuts. This works well, but for organic meshes it can end up with very fragmented maps, since the surface curves make it hard to minimize distortion.
So! That's unwrapping. On to...arranging
your faces. I'm going to list a lot of tools here because I had trouble finding all of them, and you might find it useful. You might want to just skim this, depending on how much you know.
What you have to worry about here is pretty much the same as above; distortion and ease of use. If you have a highly fragmented UV map, painting is going to be difficult. So the point here is to move faces together/arrange them in a way that is easy to paint, but doesn't stretch them too much.
In the UV/image editor, you can use most of the usual mesh-editing commands; select edge/face loops with alt-click
, select linked vertices with L
, and so on. What you can't do normally is merge/cut the mesh with the usual commands. There are two different options for merging; "V"
for stitch, "W"
for weld. Ripping is also different; it's done with "crl-L"
which stands for or un-link.
The difference between Weld and Stitch is subtle, but important; stitch can join only instances, but weld can join any two vertices. Instances are vertices that show up more than once. Consider, for example, a mesh you have cut up into islands. Because the mesh is one whole surface in the 3D view, in order to turn it into islands some vertices have to show up twice; once on the edge of one
island, and once on the edge of another. Since they're not connected, this can't show as the same vertex.
There can be more than two instances of a vertex, too. Each face that a vertex is attached to can show up on a separate island in the UV editor, and the one vertex connecting them can show up once for each face. Stitch will join these together again.
Weld, however, can join any two vertices together, even if they're not instances. I don't use this much; not sure why you would.
I used stitch a lot after a "smart projections" unwrap. Since I had lots of islands, I needed to merge some of them for easier painting. I would use Synch Selections, (mentioned below) to find out which islands go together, and then I'd move them so their instances overlap; then I could select the edges of the islands and hit "V".
This would match all of the instances that I had selected with their counterparts, and merge them halfway between the two. Since it only works on instances, you don't need to worry about which vertex goes with which, which is quite handy.
A few more tools to mention; the "W"
key brings up a menu that also contains "Align x"
and "Align y".
I don't know why these aren't U and W, but whatever. What they do is bring any selected vertices into line with each other along the selected axis. Handy for making edges square, and stuff like that.
There's also the "synchronize selection"
button. This one lurks on the footer for the window, and looks like the editing button; a square with knobs at the corners. When this is selected, any vertex or face selected in the UV editor is also selected in your 3D window.
Consequently, it also selects any other instances of that vertex. I use this to find out which islands go with which, and how they're aligned. When you're in this mode, a lot of your normal selecting options are disabled in the UV/Image editor, and moving vertices there is dangerous, since you'll move any instances, too. This can hash your map, if you're not paying attention. If your in face mode, however, you can move faces, since they don't overlap the same way vertices do. Using this feature is easier than switching in and out of synch mode constantly, if you're trying to arrange your islands.
Why? well, when you're in not-synch mode, the only UV's that show up in your editor are the UV's of the vertices that are selected in the 3D view. This lets you view your map selectively; and it's useful, but I find it easiest to keep everything selected in the 3D window. However when in synch mode, I find it best to have nothing selected in the 3D window; that way, when you make a selection, you can see it. So if I switch modes, I have to be selecting/deselecting all.
Just two more tools; "Shift-V"
. The first one is Local Stitch, or that's how I think of it. It lets you stitch all instances that you have selected that are also close enough together. This is useful if you have lots of instances you want stiched that are close together, but not with others that are far apart. For example, with an island where opposite sides are opposite instances you don't want those stitched, but you might want something in the middle stitched. This is the tool lets you do it automatically, instead of one at a time.
The second combination is the Minimize stretch command. This tool is something to use on islands that you've been merging; it arranges all of the vertices on the inside to minimize distortion, but leaves the edges alone. It seems to take a while to work, though; if I leave it sit for a few seconds it will often move the vertices around more than if I simply click it.
That's about all for tools. Take a look at your islands, and try and arrange them in a way that makes sense to you. If you want to put more detail on some faces, you can make them bigger; essentially mapping more of the picture to those areas. If you really run out of space, you can make another map, and use that for some of the faces, instead.
Duplicating your map for this purpose is really quite simple. Go to your list of UV maps; its in the "mesh" tab under the "editing" section of the buttons window. Click New to make a new map. Make sure it's your active map, by checking that the button with a grid on it is pressed. Select all your faces, and unwrap them to that map. With the faces still selected, press "Ctrl-C"
In this menu, select "tex face uv's from layer", and then select the map that the previously arranged
faces are on.
I'm not entirely sure what the name of this option means, but I know what it does; it arranges the selected faces on the active
map in exactly the same way as those faces are on the selected
map. You don't have to copy all
of the faces from one map to the other, but if you don't, it needs to be dealt with differently later, so I'm going to assume you did.
Stretch the faces that you want to see more of, and shrink the faces you don't need really small, and stick them somewhere out of the way. When you paint your image, make sure they're given nothing but alpha, and they should effectively disappear, at least as far as this map is concerned.
Ok! So now you have a map, or maybe more than one. What can you do with it? well, a few things. But I've only ever done one, so we're going to consider exporting our layout, and painting
it in another application; I'll use GIMP for my explanation, but I'm sure Photoshop can do everything I mention, and probably more. The first step is to export your layout.
So, select the faces you want to export. Go down to the bar along the bottom, and click "UVs".
At the top of this menu there's another one called "scripts";
open it up, and select "Save UV face layout".
Now you have a few options again. These are pretty self explanatory. I like to use "SVG"
and "Fill SVG",
because I have discovered that you can open these with GIMP, and it will turn them into a very nice picture, complete with white for the faces, black for the edges, and transparent everywhere else. It makes a nice, simple painting guide. If you save them as a TGA , you end up with thin black lines on a white background; not nearly as nice.
HOWEVER! You need to make sure that when you export, either you have all of your faces unwrapped to the texture, OR that you select only your unwrapped faces and ALSO make sure the button "Save all"
So I save them as an SVG, and then I open GIMP. I go to open the file as usual, and simply proceed as if it was a normal image. GIMP obligingly imports the paths, turns them into a graphic, and I can proceed from here. You can even have GIMP import the actual paths, but I don't think they'd be very useful.
I generally use several layers, and build my image in pieces. If you need to fill certain faces with certain colors, it's possible to trace them with the lasso tool, and then use the fill selection setting with the bucket. If you want to paint exactly along face lines, you can make a path along them and use the "stroke path"
button under the Paths Dialog. Another usefull tool is the "Alpha to selection"
option that shows up when you right-click a layer. When you're done coloring your image, delete the guide, save it as a TGA, and merge all the layers. Uncheck the box for compression, because if it's compressed it seems to remove the alpha.
Now you need to Apply
it to your model. Go back to Blender, and go to the materials tab. add a new material, and set it to whatever you want your base to be. Wherever the UV image is mapped to Alpha, you will see this. Any settings for Spec, Nor, or whatever, will carry through the UV image unless you set it to modify that chanel. Even then, these settings will be used wherever the UV image is not.
Now for the image! Add a new texture. Make it an image texture, and load the TGA you've just saved. Go to the Map Input tab, and set it to use UV coordinates. In the box, type in the name of the UV map you're using for coordinates. Do this for as many images as you need to. They can be mapped to any channel; Alpha, Nor, whatever. Sometimes, if the map contains alpha, the texture needs to be set to stencil. I don't know why.
Where to find your maps...
This tutorial is pretty much over. You should now be able to render your model. But if you want to stay after class, there's going to be a bit of discussion on...The problem with mutiple maps.
So, there's been something that I've sorta avoided in this tutorial. What happens of you only want to unwrap SOME faces to a UV map? Well, here goes...
This is doable. However, the problem with this, (at least for me) is two-fold. First off, it makes the map hard to work with, because you can't use the select all/de-select all in the 3D window. If you do, the UV/Image editor tries to show the un-mapped faces. They all show up as squares with their corners at the edges of the screen, and my Blender freezes up. The same thing happens if you select the Sychronize Selection button, because it automatically tries to show all faces in the UV/image editor. This is especially annoying when switching active maps.
I've worked around this, though, by making a vertex group for each set of faces that are unwrapped. This way, I can use the select/deselect buttons on the mesh groups panel to select only the faces that have coordinates. Not as nice as a simple keypress, but not bad. The Synchronize Selection button can also be used, if you're carefull to hide all the mesh except for what you're working on.
The second problem is linked to the first, but is not immediatly obvious. If you only unwrap some of the faces, the image will be still be mapped to the rest of the mesh; you'll just get the entire image mapped to each indivitual not-unwrapped (still wrapped?) face. Why? well, consider how these faces show up when you select them. They are placed completely covering the image, with a vertex at each corner. (or only half covering, if they're tris.)
So what to do about this? Well, in short, each separate partial map also needs to have it's own material. With this setup, it's possible to make a map that only applies to one part of your mesh. But all in all, it's more work than it's worth, and simply mapping the unused faces to alpha will be easier and more flexible, since you can layer maps so simply. But for the sake of completenes, I thought I should mention this.