View Single Post in: Milkshape: Adjusting UV Mapping On Your Modified Body Mesh

Admin of Randomness
retired moderator
Original Poster
#1 Old 27th Feb 2006 at 11:34 AM
Default Milkshape: Adjusting UV Mapping On Your Modified Body Mesh
Adjusting UV Mapping In Milkshape

Sometimes if the changes to your meshes are very small, you might not need to adjust the uvmapping. But other times, it's really important to take the time to do so, so that your meshes and textures will display at their best.

Here is an excellent example of why one would want to adjust the uv map; When I modified the scrubs mesh to make the medieval meshes for men and elders – I eliminated the v neckline, getting the seam to blend almost perfectly in the mesh. But… when I went to check the uv mapping, the texture did not connect smoothly across the seams.

In order to check the uv mapping and make adjustments, first you need to create a Material in the project, and then assign it to the body.

To assign the Material,
1) click to the MATERIALS tab
2) hit the NEW button
3) click the first button that says <none> and select your bmp file



4) click the GROUPS tab
5) click on BODY to highlight it
6) hit the SELECT button, you will see your mesh highlight in the other windows
7) click the MATERIALS tab
8) hit the ASSIGN button
9) right click on the window showing your mesh, and select ‘TEXTURED’ to see the material on the mesh.



Now, when I zoom in on the neckline, I can see that unfortunately, the texture does not cross the seams well at all, it’s not lined up. If I leave it mapped like that, it will be almost impossible to make the shirt front look smooth or put any designs across it. So I want to fix it.



To get to the uv map editor, use the WINDOW menu and select ‘Texture Coordinate Editor’ (or hit CTRL-T)

A window will pop up showing your texture and the uv coordinates over it. In order to see the entire uv map, I need to set the size to .5 (50%) and hit the SCALE button. You can try other sizes depending on what are you need to focus on. If we were using the Unimesh plugin, it would look something like this (this happens to be a uv map of a girl’s dress):



When you export an OBJ file from SimPE (for a Meshtool modification) the body UV Map in Milkshape is appears below the texture instead of on top of it. My example mesh was created as an OBJ file, and although it might be a bit confusing to see the map below the texture, I am using it because it is such a good example of why to take the time to fix the uv map.

When you look at the picture below, you can see the uv map points are visible below the texture. That is okay, because we can move around in the window, and zoom in and out, so to have the best view, if the points show up on the texture or not.



Now I'm going to change the scaling setting to 2, and I'm going to use ctrl-leftmousebutton to move the view so that I can focus in on the neckline area. I'm going to checkmark REDRAW, so my changes will show up as I make them.

Time to start moving the uv map points around and fixing up the mesh.

To select a point – be sure the SELECT button is clicked and then hold down the mouse button and drag over the point(s) you wish to select. You can hold down the shift key and click-drag again if you want to select yet more points.

Then you can click on MOVE or SCALE and then move your mouse to drag the points around. I seem to always want to move the points in the wrong direction, and it takes a while for me to adjust to how I need to move them to get the results I want. This is picky fiddly work, with very small movements of the points to get things just right.

You can use UNDO from the menu to step backwards, if you are not happy with the way you moved the points.



Now I am at a spot where I'm not sure which points are part of the central triangle and which are part of the main body, so I can select them in the Texture Coordinate Editor. I want to focus on the central triangle area, so I first close the Texture Editor window. Then I went over to my mesh and selected the FACES of the central triangle area I wanted to focus on. Then I went back into the Texture Editor, and only those points appeared, which will make it much easier for me to pick them and move them.



When I want to go back to seeing all the points, I can close the Texture Editor, do a 'Select All', and then open the texture editor again.

Take your time, relax, take a break if necessary. Slowly your mesh will come together…. And in the end, it can look like this!



The mesh and outfit can be found here:
http://www.modthesims2.com/showthread.php?t=99584

Included below are two template bmp files which you might like to use to fine tune your uv maps, enjoy!

Additional notes:

First, make sure you use the Milkshape commands that actually will properly add points to your uvmap if you do add points, see Milkshape Settings/Tips

The mesh shown is only the second mesh I edited, and the uvmap is indeed still a bit distorted at the neckline, not all the squares are 'square'. But as I got the lines to match across the seam, I stopped at that point. I expect if I tried again now I might be able to get it a bit better, but the distortion barely shows on the finished mesh. As uvmaps are stretched over the body, you might not always be able to get things perfectly square or even, but the closer you get, the better textures will look on your mesh.

While we're discussing uv maps, I'm going to note that Maxis uv mapped many skirts (even though they flare) with straight lines - which result in some stretching of the pattern horizontally as the skirt flares. This nice square uv mapping means that trim and checks and stripes all can be put onto the skirt and will line up easily at the seams. Now, on the other hand, if you made the hem longer or shorter - you will probably want to adjust the uv map vertically to make the boxes (I used boxes on my test pattern) as equally sized as possible, so that any sort of fabric can be used on the dress, not just solid colors.

On this example mesh with the male tunic and pants, I also stretched the shirt to be longer. I was able to adjust the uvmap to distribute the stretch, by moving the map points one row at a time vertically up and down on the uv map. The lower area is still a bit stretched, but it's less obvious. As this was one of my first meshes, I think the attempt was adequate. If I had it to do over, I might move the upper pants a bit down to make a bit more room for the tunic.

Adding totally new parts

If you are adding *new parts* to your mesh, you should uv map them to some unused part of the 1024x1024 clothing texture file, separately, *before* you add them to your mesh. (Like between the legs below the arms/hands) Read the next few messages in this thread for tips from Dr. Pixel about this. You can also view two mini-tutorials he wrote about uvmapping objects using Milkshape here: UV Mapping Shoes and UV Mapping Objects

Now that your UV Map is Changed

Now that your UV Map is changed, you will need to adjust your texture and maybe the alpha to your new layout.

This posted by Dr Pixel:
To get a copy of your UV Map (that you can use as a texturing guide) I open the finished mesh as a .ms3d file in LithUnwrap (the free version)

You can find it here:
http://files.seriouszone.com/download.php?fileid=198

On the File menu, it has an option "UV map/Save"

I set the Save window to bitmap and give it a name.

Then a second window opens, with several options. Set the options as you like and make sure the dimensions at the bottom are set correctly to 1024 x 1024 (for a body mesh) and that's all there is to it.

For a "standard" looking black and white uv_map image, set "Groups" to "black and white", and un-checkmark "fill"

If you make objects, it works great for them too - just set the dimensions to whatever image size your object is using for it's texture.

Tigger adds: For myself I usually simply take a screenshot of my map when it's set to 50% especially now that I'm working in unimesh and don't even have an obj file. The I edit it in my graphics program, removing the rest of the screenshot and then scaling it up to 1024x1024.

Now you need to go and rework your texture. Go into bodyshop, Make a NEW project, you should see your mesh with your texture on it - perhaps now some parts will look wrong (like a moved hem showing other stuff on it). Now go and edit the texture (and alpha files if necessary). You can use the uvmap graphic as a guide. If you aren't sure about all your bodyshop files, go check out the tutorials by Faylen specifically her 4th one covers the alpha file - http://www.modthesims2.com/showthread.php?t=138342. A detailed simple reworking of the uvmap and texture is also covered in Unimesh Tutorial #2

If you are encouraging others to recolor your clothing, you can include that uvmap graphic with your mesh files, to make it easier on them.

Btw, if you found this tutorial helpful, clicking on the 'Thanks' button is a good way to let me know.
Screenshots
Download - please read all instructions before downloading any files!
File Type: zip templates-patternsforuvmap.zip (106.6 KB, 7083 downloads)