|How to UV map clothing|
|• Main Index • Tutorial Index •|
This tutorial will describe my current method of UV mapping clothing models for use in Poser. Until recently, getting a user-friendly flat map has been either expensive or tedious; but this article will describe a method using only free applications. Its big advantage is simplicity. You can still get better results with more expensive mappers, but this should be good enough for most people. Most of all, it's made modelling pleasurable again. I no longer have to worry about mapping, knowing that it can all be sorted out at the end in a pain-free manner.
You'll need two programs: UVMapper Classic, and RoadKill. The download for RoadKill is a little confusing: you want the Maya version, which despite what you may think is stand-alone, not a plugin. You won't need Maya to be able to use it, fortunately. It's labelled Roadkill 1.1 (release candidate 3) - and be aware that you will get a file named RoadKill_1_1_RC3.zip, not 5vyhgt7d9t.zip as it says on the page.
Although UVMapper is available for Mac, RoadKill is Windows only. I actually use UVMapper Pro, which has many more features, but you can get good results with the free version, and it's this which has furnished the screenshots for this tutorial.
For this example, I'm using the mesh from the V3 QuickDress. If you want to follow closely, you can download a copy here.
I'll be assuming that you know the basics of using UVMapper, but are not familiar with RoadKill.
In what follows, some of the screenshots are available in larger versions so you can see more detail. Just click on it to see a bigger image, which will open in a new window. Sometimes there is no big version, which means either that I thought enough detail was visible on the small screenshot, or I forgot to make a bigger one. :)
|• Part 1: Preparation|
The first step is to make sure the mesh is "clean" - RoadKill can choke on oddly-formed OBJ files, and it's best if it already has a map.
If you're in any doubt, open the mesh in UVMapper and apply a new map. It doesn't matter at all what it is, since it will be overwritten in the next step; all that's important is that every facet has UV coordinates of some sort. A planar map will do. I know my QuickDress mesh is clean, but nevertheless here it is remapped.
It may be beneficial to weld the mesh to clean up any stray vertices. However, don't do this if you're remapping an existing model which has morphs in it - and see the warnings in the next section. In UVMapper Classic, that's Edit > Tools > Weld vertices; in Pro, it's Tools > Vertices > Weld.
To finish part 1, save the model. I like to give each different step a new file name, for example examplemesh01.obj, so that nothing is lost and I can go back to an earlier stage if it all goes pear shaped.
|• Part 2: RoadKill|
Open up RoadKill and load the file you created in the previous section.
Here are a few things that are worth remembering if you're coming to RoadKill for the first time, especially if you've been used to using UVMapper. RoadKill is still in development - it has quirks, and it just does some things differently.
You'll see you have a 3D view of your model on the left, and a 2D view of the UV map on the right. The model has a chequerboard pattern applied to it, which will show you how even your mapping is. At the moment, it's terrible. :)
You can rotate your view of the model by holding down the ALT key and dragging in the 3D window with the left mouse button; pan by holding ALT and using the middle button (or pressing the scroll wheel); or scale (zoom) with ALT + right button. With the exception of rotation, the same actions work in the 2D view. To reset the view, hit the A key.
I always start by welding the whole mesh (this isn't the same thing as welding vertices, by the way; it's UVs we're welding here). Go to Edge Mode > Select (or press the E key).
Select everything - notice that you can select by dragging the cursor in either view. I usually use the 3D view port, for reasons which will become apparent soon, but sometimes it's easier to get a view of the part you want to operate on in the 2D view.
The bits you select will turn orange. Then press the W key to weld everything that's selected.
Unless you have a blindingly fast computer, at first it will seem as though nothing has happened. RoadKill works in the background, which is good because it can take a long time to flatten a complex model. However, it can be confusing to begin with since there's no progress indicator.
You can continue working while RoadKill is thinking. This is one reason why I usually work on the 3D view, because if you zoom in on some interesting spot on the 2D view, you will lose your place when it gets remapped from under your feet!
Here's the remapped dress. Only the very simplest meshes will be usable at this stage - you can see how distorted the mapping is at the moment. For most models, we need to define seams. Think of it like taking a piece of real clothing and cutting it along the seams - you'd end up with a bunch of flat pieces of cloth. This is very similar to the results we want when mapping a 3D model - a bunch of nice flat templates, ready to texture.
I've zoomed in, and dollied around so I can see the back of the dress. For clarity, I'm only showing the left hand (3D) pane of RoadKill.
I'm going to make my first cut down the back of the dress. Stay in Edge Mode > Select, and also do Switches > Don't select back faces. This will stop you selecting edges whose faces are pointing away from you - so you can put a seam on one side of a skirt, for example, and not have it appear on the other side as well. More complex shapes may well have more than one face pointing towards you depending on your viewpoint, and in this case you can end up with a seam or seams where you don't want one as well as one where you do. Don't worry if this happens. Any overcutting can be easily undone, and I'll illustrate that later.
In this shot, I've selected a single edge which will be on the seam I want. Notice how it turns orange.
This shot shows what happens if I double-click on the same edge. RoadKill tries to select all the edges which connect with it to form a whole seam; in this case it was successful. It isn't always that simple, but it's easy enough to fix if it goes wrong.
Now I press the C key, and the selected seam will turn purple.
I could have continued cutting while RoadKill thought about the flattening, but here's a screen shot which shows what happens if I let it finish.
If you accidentally make a cut where you didn't want one, if you change your mind, or if RoadKill didn't select the edges you hoped it would, select the cut seam and press W to weld the edges back together again. You don't need to be so precise in your selection when welding, since anything that's already welded won't mind if you weld it again - so you can just drag a selection across the rough area you want to fix.
For more precise, detailed work, you can cut individual edges. Hold down the C key as you click, or W to undo the cuts.
Another useful selection method is Topological. Select one edge, then hold the T key while you select another. Your selected edge turns yellow, and RoadKill will try to join up your selections while following the contours of the model. It doesn't always do what you'd hoped, but can save time even if you end up re-welding some of the cut.
Here's the QuickDress all cut up. As well as the seam up the back which I started with, I've made cuts on top of the shoulders, cut the sleeves off, and cut the sleeves down the bottom surface so that they open out.
There's more than one way to cut up a model, so try experimenting with different seams to see which works best.
If you're happy with the cutting - don't worry if the pieces
aren't arranged very nicely, we'll fix that next - save the model.
Remember, always use "Save As" to avoid overwriting
your original model - you still need it.
It sometimes happens that RoadKill doesn't flatten your mesh very well - no matter how you cut the seams, the pieces you end up with are not symmetrical, which will make them difficult to texture later on.
|• Part 3: UVMapper|
If you open the model you saved from RoadKill, you may well see that it's much bigger than it was when you started - a disaster for Poser conforming clothing, and a pain for other models too. RoadKill normalises the scale of your model, and since Poser models are tiny compared to most of the 3D world, they get magnified hugely. If you remapped an existing clothing model, the RoadKill output will also have lost all the grouping and material zones. These things are easily fixed, as long as you still have your original (pre-RoadKill) model.
In UVMapper, open the model you saved from RoadKill. Now go to File > Export UVs. Make sure that all the options are unchecked, because we don't want group or material information in this file, just the UV mapping. Save your UVS file with a memorable name.
Now open up your original model in UVMapper, and go to File > Import UVS. Select the UVS export file you saved in the previous step. This applies the RoadKill mapping, but doesn't change the scaling, or overwrite the original grouping or material zones.
Now you can tidy up the mapping if you want to. RoadKill tends to place the parts it's cut close to the edges of the map area, which can make it difficult to avoid seams when texturing. Select each part in turn, and either drag it with the mouse or use the cursor keys to put it where you want it.
While you're doing this, it's important to retain the proportions and relative scaling of the parts, so don't scale anything at this stage. It's too easy to make the left sleeve 90% of the size of the right sleeve, and that will make texturing very tedious. Moving parts with the cursor keys is safer than using the mouse, because you can't accidentally grab the edges of the selection and make things non-square. Don't worry if there's a lot of white space left on your map at this stage. Just try to group things together in a roughly rectangular arrangement.
If you have UVMapper Professional, then you have a few more options available to you - you can rotate your selection, for example, to get a better fit.
Here's my remapped dress - I've moved the sleeves around to make better use of the mapping space, and then moved everything into the centre to take it away from the edges.
If you were mapping an original model, you can now assign material zones and so on, if you want them. If you're making conforming clothing, you may wish to add groups too. Then apart from the fact that some of the mapping space is wasted, this is more or less finished. You do need to remember to save it from UVMapper, of course. :)
Read on, and I'll tell you how to maximise the mapping space and make best use of your precious texture memory. This procedure works no matter how you generate your maps, by the way.
|• Part 4: A note on Templates|
In part 3, I told you not to do scaling on the RoadKill map, because it will automatically have the right aspect ratio and you don't want to spoil that. When you paint circles on your texture template, they will come out close to circular in your render.
However, this will often mean that your texture map doesn't fill the space available to it, meaning you're wasting your texure map resolution; but if you maximise it, the aspect ratio will be lost. What to do?
After maximising, you can output a template of the opposite aspect ratio, so that texturing will be easy and the map is filled. Here's how.
In UVmapper, save a square texture template (i.e. equal width and height). It doesn't have to be big: 256 x 256 is good enough. This is only a temporary measure, and will be overwritten later on. UVMapper Pro users can just copy the default square template by pressing CTRL-C.
Open your template in IrfanView (or any other image editor which will tell you what the aspect ratio of a rectangular selection is). If you copied your template from UVMapper Pro, paste it in instead of opening it.
Drag a selection around your template, to represent where you would like the edges to be. Notice a couple of things here:
Take note of the aspect ratio of your selection (in the example, it's 1.100 - you can see it in the title bar of the window).
Now we have to do some maths. Ugh.
Decide what you want the biggest dimension of your final texture template to be: 1024 pixels, say. If your selection was landscape format (wider than it was tall), then the aspect ratio you see in the previous step will be greater than 1; if it was portrait (taller than it was wide), your ratio will be less than 1. By the way, if your ratio comes to 1, you don't need to do this step. A square template will be ideal.
For a landscape template, its width will be 1024 (or whatever figure you decided on), and its height will be 1024 divided by the aspect ratio.
For a portrait template, its height will be 1024, and its width will be 1024 multiplied by the aspect ratio.
Make a note of the dimensions of the template you want. For this example here, our template will be landscape. So, divide 1024 by 1.1 to get 930.909090... and so on until the end of the universe. Let's call that 931, shall we?
In UVMapper, select all (CTRL-A) and press the equals (=) key to maximise the map. You won't want it to go right to the edges, since that will make texturing difficult, and we're trying to make it easier. Press the keypad minus (-) key a few times to scale it down a bit.
Now save the model, to a new name if you wish. That will be your final mesh.
And lastly, save the template. In the boxes where it asks for the size, enter the height and width you worked out above.
|• Main Index • Tutorial Index •|