What UVW mapping is, and how to save some time while doing i
Come here for tutorials and 3d training. The aim is to point out good 3d training sites or methods.

Moderators: Winterhawk99, Mermut, Bannor Bloodfist

Post Reply
Estelindis
Posts: 291
Joined: Sun Sep 24, 2006 12:05 pm
ctp: Yes
dla: No
TBotR: No
nwnihof: Yes

What UVW mapping is, and how to save some time while doing i

Post by Estelindis »

I just made a small but useful discovery. :) You can save a UVW map and load it into another object! :D Allow me to explain this so that I can share this information with other people who are just starting modelling, like me. ;)

Two quick points before I begin:
  • I use GMax; I hope these methods and explanations make sense for 3dsMax users too. :D
  • I am including some basic explanations of the things that it took me forever to figure out, in case anyone else is a total beginner and frustrated by explanations that already assume you know a lot. ;) But if you already know how to UVW map, skip down to the last step, which is entitled "Saving and reloading a UVW Map"!
What's a UVW map?

A UVW map is a texture map that decides which bits of a texture an object uses and where it uses them. If you remember your geometry, a 3d object has x, y, and z axes, with x being for horizonal on the ground, y being for vertical on the ground, and z being up into the air. :p (Most of us have used those values if we wanted to shift a placeable around in NWN with the "adjust location" tool.) Well, when we're not talking about objects, but about the textures those objects use, we don't speak of x, y, and z anymore. Instead, x = u, y = v, and w = z. Any coordinate you give to determine which bit of a texture is used by an object thus has u, v, and w coordinates (though I have never made "w" anything but 0, what with textures being 2d :D). Anyway, that's why a texture map is called a UVW map. ;)

How do I modify a UVW map?

First, you need to be able to edit the model using a 3d editing program. Load up the excellent (and free!) 3d utility Gmax (or, if you use 3dsMax, your copy of that - but I can't guarantee that all my directions will apply!). You should have NWMax installed as well. (If you don't have one or both, you can download them via those links.) Once Gmax and NWMax are loaded (they load together automatically if you double-click your NWMax icon), go to "MDL Loading" in MWMax and find the .mdl file you want to work on using the "Browse" button. Make sure "Import Geom+Anims" is chosen; not every model will have animations, but it's good to be on the safe side. Now click the "Import" button. You should now see your model in GMax! :)

Next, you'll need to select the object whose texture mapping you want to modify. (An object is part of a model.) There are a number of ways you can select an object. You can use your mouse - if you have problems, make sure it's in pointer mode (the pointer in the top toolbar, five buttons from the extreme left, should have an orange background). If you can't see the object, it might be obscured by a walkmesh helper or some other large object (in which case I suggest that you select the object that's in the way, right-click, and choose "hide selection"). Or, if you know the name of the object you want to work on, you can go to the "edit" menu, go down to "select by," and slide across to "name." You can then select the object you want to work on from a list.

Once you have selected your object, go across to the tools on the right-hand side of the window. There are six little icons at the top of that toolbox. The second from the left (or fifth from the right - the right-most is a little hammer) is a little blue rainbow. The blue rainbow is the "modifiers" button. Click it. A bunch of information and options should appear below it. First up, you'll see the name of your object. Looking down, directly beneath the name you'll see "Modifier List." Click it and a big list of options will show up. Go down to the heading "UV Coordinate Modifiers." This is your UVW mapping toolbox. There are a number of pre-set UVW maps that you can apply if you choose "UVW Map" from the list (options for maps like Box, Face, etc., will appear in the toolbox). If you choose this, it replaces the existing UVW map! Alternatively, you can edit the existing UVW map by choosing "Unwrap UVW" from the list (it's the one below "UVW Map"). Under "Parameters" there will appear an "Edit" button. Click that to edit your UVW map - a window entitled "Edit UVWs" will appear, in which you can move around the various coordinates that control the texture mapping. :) You'll see a bunch of little triangles (each point of which is a UVW coordinate). These triangles in the UVW map correspond to the face triangles in the object (or, as Dragonessa says, the techy term: mesh!) :) [By the way: while editing the UVW map, I recommend keeping the "Edit UVWs" window at about half the size of your screen, and using the other half for a close zoom on the object you're working on, which you should be able to see in all its textures in the Perspective window. If it's too tiny, use the zoom tool in the bottom right-hand corner.]

There are a number of ways in which you can edit a UVW map, and I haven't even discovered them all yet. :D You can move the whole thing around by dragging your mouse over all the coordinate points (when they are all selected, they'll all be red) and then using the move tool (top left corner) to move them around. (If you can't see all the coordinates, use "pan" and/or "zoom" in the bottom right corner.) This shifts what parts of the texture the object uses without changing the overall shape of the texture map. Or, if you like, you can move small groups of coordinates, or even single coordinates. Just drag the mouse over whichever coordinates you want to select, or click a single coordinate to select just that one. One handy tool in the bottom left corner lets you type in u, v, and w values (but, again, don't change w!) for whatever coordinate(s) you have selected. By typing, you can be quickly sure to put a coordinate (many of them) exactly where you want it/them to be. ;) You can also keep the general shape of the UVW map but change the size by selecting the whole thing and using the "scale" tool. (This is really useful! :D) Once the object looks as you want, just close the "Edit UVWs" window.

Exporting your model

If you've finished your work, unselect whatever you were working on, and select the model base (it's handy to "Select By Name" and tick "Display Subtree" to help you find the model base; for example, in the case of a tile, what you need to select is the object of the same name as the tile). Now, click the blue rainbow of Modifiers tab in the toolbox on the right-hand side of the main window. Under the model name and the modifier list, you should be able to select "AuroraBase." Once you do so, some information and options should appear under the heading "MDL Base Parameters." Click on "Browse" to choose an export directory if necessary. Then click "Export Model+Anim" - and you're done! You'll find the model in whatever export directory you chose. :)

Saving and reloading a UVW Map

And now we get to the actual part that Bannor asked me to write a quick tutorial to explain! :D Going back to before you exported the model... suppose that you spent a while changing the texture map for one object, and you want to apply those changes to a bunch of other identical objects (whether in the model you're currently working on or in another model). Do you need to do all that work again? Certainly not! Remember, if you click "Unwrap UVW," a button appears that allows you to edit the UVW map bit by bit? Well, directly beneath that button, there are two other buttons: "Save" and "Load." To save the uvw map of the object you have selected, click "Save" and give it a name you'll remember easily. Then, select the other object you want to apply it to, click "Unwrap UVW," and then click "Load." Choose the UVW map you saved. Now it's applied to the other object. Repeat as you please. :)

Ta-da! Now, to invent the wheel... :lol:

_________________
If anyone else on the team wants to make any improvements to the tutorial, btw, feel free to edit it!

User avatar
Pstemarie
Posts: 157
Joined: Sun Sep 12, 2010 6:42 pm

Post by Pstemarie »

Este,

Nice work here! I'll be sure to keep a copy pinned to my desk! :D

Estelindis
Posts: 291
Joined: Sun Sep 24, 2006 12:05 pm
ctp: Yes
dla: No
TBotR: No
nwnihof: Yes

Post by Estelindis »

Thanks, PSM. This really is a voyage of discovery for me, but it has its share of icebergs too! :D

Post Reply