View Full Version : Merging Models Tutorial

07-06-2006, 07:39 PM

Lord Spartan asked me if I could explain better how to merge models, so I decided to make a tutorial step by step, this first part is about loading the file in Gmax and organizing the workspace. I'll be using the model pmbil as a base, and we will merge another body model mesh.


1. The Tools

1.The Kotor Tool by Fred Tetra you can find here:

2.MDLops by Cchargin:

3.Gmax, if you are new to 3d modelling you should download the tutorials and help files too:

4.Nwnmax for Gmax:

5.Taina's Replacer:

2. Loading the model

Once everything is installed and working let's create a folder for the project....I'll call it NewRobes. Next we extract the pmbil model from the game to NewRobes folder, to do that open Kotor Tools and select:
Kotor I -> BIFs -> models.bif -> Aurora Model -> pmbil.mdl
Then press the button “Extract File” and save the file on NewRobes folder.

http://img310.imageshack.us/img310/1103/pic019yd.th.jpg (http://img310.imageshack.us/my.php?image=pic019yd.jpg)

The model's name is codified:
p -> player model
f or m -> female or male model
b or h -> body or head model
a or b ->underwear or cloths model
l, m or s -> large, medium or small body (soldier, scout or scoundrel)
a, b or c -> asian, black, caucasian skin colour (for heads) the number is the portrait used.

Extract the .mdx file and save in the same folder.
Kotor I->BIFs->models.bif->Aurora Model Extension->pmbil.mdx
To extract the texture used by the model:
Kotor I->ERFs->TexturePacks->swpc_tex_tpa.erf->P->pmbi01.tpc

http://img420.imageshack.us/img420/5608/pic029ha.th.jpg (http://img420.imageshack.us/my.php?image=pic029ha.jpg)

If you don't know which textures the model uses I'll show you later how to find it. If you double click over image the image viewer will show it, if there is nothing written in the white box we can press the “Extract file”, select “Save as tga”, and save it in the same folder.

http://img437.imageshack.us/img437/9296/pic039dt.th.jpg (http://img437.imageshack.us/my.php?image=pic039dt.jpg)

But our texture has a text there, so we will copy it to a text file too, to do that we check the “Export Selection to TXI file”, select the text, press “Write File”, we save it in the same folder as the model files.

http://img480.imageshack.us/img480/5163/pic048gk.th.jpg (http://img480.imageshack.us/my.php?image=pic048gk.jpg)

Now in NewRobes folder we have four files pmbil.mdl, pmbil.mdx, pmbi01.txi and pmbi01.tga.

http://img490.imageshack.us/img490/373/pic072ns.th.jpg (http://img490.imageshack.us/my.php?image=pic072ns.jpg)

We are going to convert the pmbil.mdl from binary to ascii file, using MDLops. Start MDLops, activate “Kotor 2” button, and press “Select file” button, and select the file pmbil.mdl.
I usually let the “Extract animations” checked, I have seen some tutorials that says it should be unchecked though... Then press the “Read and Write model”, it will create a pmbil-ascii.mdl and pmbil-textures.txt file inside the NewRobes folder. The pmbil-textures.txt file tells which textures is used by the model, it is very useful if the model uses many textures with different names.

Now we start Gmax, remember to start Gmax not using its icon, but using Nwmax's icon, it will start the Snooper script too, without it you will have to paste the text from the Gmax's listener and copy on a text file to export the model. Gmax will start and the Nwmax roll-out will open.

http://img272.imageshack.us/img272/7946/pic086yi.th.jpg (http://img272.imageshack.us/my.php?image=pic086yi.jpg)

To import the model we select it in the Nwmax roll-out “MDL Loading”, in the file name we use the browse button to select our pmbil-ascii.mdl file, in Options check “Import Geom Only” and then press “Import” button. The model and a lot of other stuff will appear in the screen. Minimize the Nwmax roll-out.

http://img530.imageshack.us/img530/7686/pic107ri.jpg (http://imageshack.us)

On the screen we have 4 panels...the Top, Front, Left and Perspective views, when you click inside one of the panels it is activated and it is shown by turning its board gray instead of the default dark blue.

http://img223.imageshack.us/img223/5154/pic128kx.th.jpg (http://img223.imageshack.us/my.php?image=pic128kx.jpg)

You can change one panel to the other right clicking on the panel's name and selecting it in the menu, or using the shortcuts, T to top, B to bottom, L to left, R to right, F to front, K to Back (on Kotor models front and back are reversed), P to perspective, U to user view.

http://img90.imageshack.us/img90/8933/pic118zg.th.jpg (http://img90.imageshack.us/my.php?image=pic118zg.jpg)


07-06-2006, 07:54 PM
Now with the perspective panel activated we go at the bottom right of the screen where there are some tools to manipulate the visualization of the 3d space.

http://img20.imageshack.us/img20/5792/pic262aj.jpg (http://imageshack.us)

Some tools have only one option of use, but others have a small arrow on the right below it, if you put the mouse over the icon it will shows what the tool does, if you click on the icon it will turns orange showing that it is activated, if you hold the click it will show the other options for the tool as more icons, and to deactivate it just right click on the panel.

http://img225.imageshack.us/img225/3729/pic272wq.jpg (http://imageshack.us)

The default icons are from left to right and top to bottom,:
Zoom (shortcut key Z);
Zoom All – it zooms on all panels at same time (shortcut key assignable);
Zoom Selected – zooms selected objects (shortcut key E) or Zoom Extents (option)– zooms all the objects in the scene (shortcut key CTRL+ALT+Z);
Zoom Selected All – zooms selected objects in all panels (shortcut key assignable) or Zoom Extents All (option) - zooms selected in all panels (shortcut key SHIFT+CRTL+Z);
Field-of-view (works only on perspective panel – works as a zoom) or Zoom Region (option) – zooms a piece of the space delimited by the mouse (shotcut key CTRL+W);
Pan – moves the panels to the sides or up-down (shortcut key CTRL+P);
Arc Rotate – rotates the view (shortcut key V or CTRL+R);
Min/Max Panel – minimizes and maximizes the panel (shortcut key W);

So, with the perspective panel activated let's click on the “Min/Max Panel” (shortcut W), and it will increase the Perspective panel to fill the place of the 4 original panels.

Now use the visualization tools to see what we have on the 3d space... remember that if you want to undo the visualization you need press SHIFT+Z and to redo SHIFT+A.

I've used the arc rotate and zoom to get the image on the left on the maximized perspective panel. Here in the 3d scene we have the painted model's mesh which is the model that we see in the game.

http://img85.imageshack.us/img85/6638/pic148oj.jpg (http://imageshack.us)

There are some wire blue boxes , they are called helpers, they are used by the game to place other models or visual effects on the model's body. We should not change them, and we will use the bigger one at the base of the model to export it back to the game.

There are some colored solid polygonal forms, they are the bones, it means that if you move or rotate them, the body's mesh will deform or move to follow the movement. We will not use them yet, they are only used on Gmax when we need to fix the bones deformations, we will do it after the modeling and texture is done because if we change the number of vertices of the model the bones weight on each vertex will be recalculated and we lose part of the work done, this bones are used to create the character's shadow in the game too. And there are some white wire tetrahedron and icosahedron forms, they are bones too, but they are used to place the solid bones.

Let's save the file, go to the “File” menu and select “Save” choose a name and after the name add a number (for example: Robes_01) save it in the NewRobes folder.

Now, next time we save it after we have made a big change on the model we can use the “+” button that appears in the save dialog windows and it will save it as a new version, if you don't want to save as a new version you can use the CTRL+S to save over the file.

http://img338.imageshack.us/img338/8145/pic150jb.th.jpg (http://img338.imageshack.us/my.php?image=pic150jb.jpg)

So let's select only the meshes and hide everything else that we won't be using by now, when we click on the “Select by name” icon (shortcut key H), on the top tool bar in the screen.

http://img247.imageshack.us/img247/7854/pic168hr.jpg (http://imageshack.us)

It will open the “Select Object” window check the “Display Sub tree” this will show a tree showing the hierarchy between the meshes, which are linked. In the list we will select the names, with the CTRL key pressed: torso, LArm, Rarm, feet.

http://img221.imageshack.us/img221/6295/pic172wn.th.jpg (http://img221.imageshack.us/my.php?image=pic172wn.jpg)

Those are the meshes that of body, that we see in the game, once they are selected in the list, press the “Select” button, and in the 3d scene you will see those meshes with a white wireframe around it, to show that they are selected.

http://img99.imageshack.us/img99/4996/pic187um.jpg (http://imageshack.us)

Now we will save this selection, with those 4 meshes selected write on the white space of the upper toolbar the name of the selection (for example: Mesh), then press the ENTER key.

http://img504.imageshack.us/img504/9365/pic282nd.jpg (http://imageshack.us)

To deselect those meshes click with the left mouse button on the 3d scene, now if you want select the meshes back, just select it on the toolbar using the arrow to browse the names of the selections.

http://img195.imageshack.us/img195/6415/pic295aq.jpg (http://imageshack.us)

With those 4 meshes selected, let's hide them clicking with the right mouse button in the 3d scene a red menu will appear, select “Hide Selection”.

http://img195.imageshack.us/img195/2022/pic197nj.th.jpg (http://img195.imageshack.us/my.php?image=pic197nj.jpg)

Now we are left with only helpers and bones, let's separate them too... in the “Select by Name” icon open the “Select Object” window and select everything that has an _g at the end of the name, it will select all the bones, if the window closes, just call it again and continue the selection. Once you are done call the red menu and use the “Hide Selection”, if there is no bone left on the scene undo the hide (CTRL+Z) and name the selection as Bones and hide them again, now we have only the helpers.


07-06-2006, 08:02 PM
http://img191.imageshack.us/img191/6008/pic216gm.jpg (http://imageshack.us)
http://img222.imageshack.us/img222/42/pic234ta.jpg (http://imageshack.us)

Select all that is left using the “Selection by Name” icon and create another selection called Helpers, and hide them too.
Now we call back the mesh just selecting it on the name of the selection, a warning box will appear to tell that the objects of that selection is hidden and asks if you want it to bring them back, click yes.

http://img193.imageshack.us/img193/3545/pic308bi.jpg (http://imageshack.us)

Now we have only the 4 meshes on the 3d scene, it is a good time to save your work.

There is a problem with the uv map of the model, the texture is not in the right place, but as we are not going to use it anyway there is no reason to worry.

http://img193.imageshack.us/img193/1217/pic254pb.jpg (http://imageshack.us)

One important step is chose the right base mode for the model we are going to merge, in the model we've choosen (pmbil) the feet and gloves are separated from the whole torso, so the mesh we are going to add must be separated the same way, otherwise we will have problems with the bones as their configuration fits how the mesh is separated.

http://img391.imageshack.us/img391/6195/pic313yj.th.jpg (http://img391.imageshack.us/my.php?image=pic313yj.jpg)

We can use a model that already have the same separation, Carth's cloths for example would fit well as it is separated the same way, or we can remodel our model to fit it.

http://img377.imageshack.us/img377/8923/pic329fd.th.jpg (http://img377.imageshack.us/my.php?image=pic329fd.jpg)

Here I remodeled Carth's cloths to fit his underwear bone configurations.

http://img183.imageshack.us/img183/4985/pic331yd.th.jpg (http://img183.imageshack.us/my.php?image=pic331yd.jpg)

That is how I load the base model, in part II we will see how to import and merge the new model.

07-06-2006, 11:29 PM
Well, I think you just earned a spot in the Modeling Tutorial Subforum.

Very nice work... this is impressive.


Lit Ridl
07-07-2006, 01:40 AM
Who will add this to tutorials section???
Add it, please!!!!
It is nice work!!!

07-07-2006, 03:17 AM
That is how I load the base model, in part II we will see how to import and merge the new model.
Very nice work Kha :thumbsup:

I've added this section to the modeling/skinning Tutorials section, but I'll keep an eye out for part II and add it whenever it becomes available :)

I've taken the liberty of copying all of the images you've used in the tutorial since Imageshack has a way of "losing" pics at the most inconvenient time.

I'll re-link the pics in the sticky with the ones I've copied once I upload them to starwarsknights.com for a more stable and "permanent" home.

Again, very nice work. Thank You for taking the time to do this.. many ppl, including myself will find this information very helpful :D

07-07-2006, 06:30 AM
Very nice work there, Kha! I can understand something to do with modeling which means that it must be pretty good. I'm glad ChAiNz has put this one up in the tutorials section. You deserve it :thumbsup:!

07-07-2006, 11:17 AM
Thank you for this Kha I have a feeling I will have some great use for this in the near future.

07-07-2006, 01:41 PM
Thank you guys!
Chainz you can do whatever you think is better, thanks.
As soon as I finish the next part I'll post here. :D

07-07-2006, 02:22 PM
I tried to install Gmax and it said "Fatal Error: Interactive 3D Renderer initializaton failed.Please check your device settings by using the -H command line option"

What the Frack does that mean??

07-07-2006, 06:38 PM
Great work Kha. I can't wait for part 2. :)

07-07-2006, 09:35 PM
I tried to install Gmax and it said "Fatal Error: Interactive 3D Renderer initializaton failed.Please check your device settings by using the -H command line option"

What the Frack does that mean??
This means that there is some problem to initiate something Gmax needs, do you have the Minimum System Requirements for it?:

Windows® 2000 or Windows® 98
Intel or AMD processor at 300 MHz or better
128MB RAM and 300MB swap space
Graphics card supporting 1024 x 768 x 16 bit color
OpenGL and Direct 3D/Direct X hardware acceleration
Windows-compliant mouse

07-07-2006, 10:08 PM
:monkey4: This is solid gold Kha, thank you very much.
I'll wait patiently for part 2.

07-08-2006, 02:16 AM
I tried to install Gmax and it said "Fatal Error: Interactive 3D Renderer initializaton failed.Please check your device settings by using the -H command line option"

What the Frack does that mean??
Edit gmax shortcut from desktop and add " -h" to command line. In this way you can choise again 3d renderind driver (suggest to choise between directx and opengl). If all fails stay on "software". After you get over and make gmax work remove " -h" part from command line.

07-11-2006, 10:45 AM
Here is the second part, not the merging yet... but it is coming!

3. Preparing the model

Now we are going to work in the mesh we want to merge in our base, there are three reasons we want to merge meshes on the bases:
1.we have a new model modeled on another 3D program or even in Gmax/3DMax but it is a file without all the aurora base polygons/helpers/bones.
2.we want to merge parts of different models, for example, the torso of one model, the legs of other and the arms of a third one.
3.we have remodeled a body model from one game and want to port it to the other. If someone knows a better way to do it let me know, but remember that porting is illegal, only do that if the model you worked with is in both games.
I'll cover all those situations, the 1st and 2nd requires some modeling and UV editing/texture painting, and all of them will require bone weighting. So in this part we will talk about how we go into modeling in Gmax.

3.1 Importing a new model into Gmax.
Lord Spartan exported one of the body meshes to another program to remodel it, that is why he asked about merging, how he can add his new model into the game? So I have here the 3DS file of his model and we are going to import it into Gmax.
Start Gmax and open the file we loaded in the first part of this tutorial (Robes_01.gmax) and hide everything.
In the “File” menu click in the “Import”, choose the .3DS file and click ok in the 3DS Import warning, with “Merge objects with current scene” checked.


And in the next 3DS Import warning click no.


As this model was extracted from the game it follows the same division as the original model, the torso is separated from the arms and legs. But even if it was one whole piece we could just cut them to fit the bone setup. And both models are the same size.

http://img134.imageshack.us/img134/8980/pic384ha.th.jpg (http://img134.imageshack.us/my.php?image=pic384ha.jpg)

With all those separated parts selected let's save this selection the same way we have done with the bones, helpers and mesh, name this selection model.

http://img134.imageshack.us/img134/6374/pic391hj.jpg (http://imageshack.us)

So let's see how the original model was constructed and them compare with our new model to see if it requires any modeling. Hide the Model Selection and unhide the Mesh selection.

http://img61.imageshack.us/img61/3699/pic401kb.th.jpg (http://img61.imageshack.us/my.php?image=pic401kb.jpg)

Select only the torso by clicking with the left mouse button over it, and click on the “Modify” icon on the Gmax roll-out.

http://img61.imageshack.us/img61/534/pic414hr.jpg (http://imageshack.us)

Here is where we control what we are changing in the model. Under the “Modify” icon there is the name of the mesh, in this case Torso, and the “Modifier List”, with the “Skin” and “Editable Mesh” modifiers.

http://img76.imageshack.us/img76/223/pic427ao.jpg (http://imageshack.us)

Those modifiers are applied to the mesh to modify it somehow, using the “Editable Mesh” modifier we can move, delete, create vertices in the mesh, it is here that we model the it.

The “Skin” modifier is used to apply the bones to the mesh, and to change the influence of the bones over the vertices of the mesh. We shouldn't change the order that the modifiers are applied on the mesh.

If we wanted to change the mesh texture we would need to change the meshes' Uvmap for that we apply the “Unwrap UVW” modifier on the Torso mesh.

Select the “Editable Mesh” modifier, because we want apply the “Unwrap UVW” modifier over the “Editable Mesh” one, when you select it a warning will appear to tell you that there is another modifier, the “Skin” that depends of the “Editble mesh” and if you change or add something between them something weird can happens, just say yes.

http://img84.imageshack.us/img84/651/pic438ur.th.jpg (http://img84.imageshack.us/my.php?image=pic438ur.jpg)

Now we click on the arrow beside the Modifier list, a big list of modifiers will appear and we select the “Unwrap UVW” in the “UV Coordinate Modifiers”.

http://img101.imageshack.us/img101/4118/pic443xe.jpg (http://imageshack.us)

Ok, we have the 3 modifiers we need to change our model to use it in game, under the list there are some icons, the second one (show end result on/off) when it is active it is white and it shows the effect of all the modifiers applied to the mesh on the 3d scene, when it is deactivated it is half white and half gray, it shows only the effect of the modifier selected. Some modifiers doesn't allow it show the effect of others... for example the “Editable Mesh” when selected, it doesn't allow the “Skin” modifier shows its effect, even if icon is white. The light bulb turn on/off the modifier, but you can not see the difference now.

http://img119.imageshack.us/img119/7054/pic451zb.jpg (http://imageshack.us)


07-11-2006, 10:58 AM
So let's see how each modifier works (good time to save your work) ;).

Select the “Editable Mesh” with the left mouse button, say yes to the warning, and click on the “+” icon beside the “Editable Mesh” modifier name. You will have a list that what can be selected and modified on the model.

Select the “Vertex” (selection mode) and you will see blue points all over the model, they are the model's vertices. If the vertices are blue it means they are deselected, when they are selected they are shown as red.

http://img114.imageshack.us/img114/5697/pic464nq.th.jpg (http://img114.imageshack.us/my.php?image=pic464nq.jpg)

To select a vertex or any other geometry (once its selection mode is selected) you just need to left click on it or create a box with the left mouse button. Once a few are selected you need to press the CTRL key to select more or the ALT key to deselect some of them. If you want to view the edges too you can activate /deactivate it pressing the F4 key.

Under the modifier stack there are some options and tools to select and manipulate the geometry. It is a long panel that can be moved up and down with the mouse when the mouse icon turns to a hand.

The first part of it is “Selections” options.

http://img130.imageshack.us/img130/9578/pic475uh.th.jpg (http://img130.imageshack.us/my.php?image=pic475uh.jpg)

There is a row of icons, they are “Vertex”, “Edges”, “Face”, “Polygon” and “Element”, you can activate them here or use the list under “Editable Mesh” modifier.

To select a polygon you need to use the “Face” or “Polygon” selection and click on the polygon, only its borders will show selected in red.

http://img220.imageshack.us/img220/3606/pic483ny.th.jpg (http://img220.imageshack.us/my.php?image=pic483ny.jpg)

Some meshes like the torso is composed of many separated pieces of meshes, you can see the pieces using the “Element” selection, all the polygons of the separated piece are shown.

By selecting the elements of the torso mesh we see that it is one mesh composed of many smaller separated pieces.

http://img74.imageshack.us/img74/6109/pic492el.th.jpg (http://img74.imageshack.us/my.php?image=pic492el.jpg)

This separation is important when you don't want all your model to be smoothed. All the edges of connected faces are rendered by the game as smooth, and the disconnected ones have a hard edge where it is not connected. Those hard edges are good for separate different pieces of cloth of the model.

In this Carth model, for example, you can see this seam in his arms because there is a cut necessary for the uvmap, and as Mdlops don't use the “smooth group” information from Gmax yet it can not be smoothed, so we get those seams, all the other faces of the model are connected so it is smoothed, there is no hard edges.

http://img99.imageshack.us/img99/9589/pic611cj.th.jpg (http://img99.imageshack.us/my.php?image=pic611cj.jpg)

Let's see the elements of our new mesh... click in the “Editable Mesh” modifier to disable the mesh editing, hide the mesh and unhide the new model.

http://img135.imageshack.us/img135/1963/pic594xp.th.jpg (http://img135.imageshack.us/my.php?image=pic594xp.jpg)

Here in the modifier list we have only the “Editable Mesh” modifier, click on it and select “Element”.

Now click over the model to select its elements.

http://img489.imageshack.us/img489/1527/pic609pa.th.jpg (http://img489.imageshack.us/my.php?image=pic609pa.jpg)

In this case due to the export/import when we select its pieces we only get one face (the face we clicked over), it means that in each face its vertices are not connected with the vertices of their neighbour faces, it will require some modeling to weld all those vertices together and separate the pieces. If we put this model in the game as it is we would see a seam around each face.


07-11-2006, 11:10 AM
3.2 Basics of Modeling.

Once we have some element selected (i.e. vertices, edges, face, polygon or elements) we can move, rotate or scale them, using the appropriate icon from the upper toolbar.

http://img109.imageshack.us/img109/9690/pic818lt.jpg (http://imageshack.us)

With some element selected we activate the “Select and Move” (cross arrows) icon, clicking and holding on the selected element and moving the mouse we can move the selected element.

http://img79.imageshack.us/img79/4922/pic503hl.th.jpg (http://img79.imageshack.us/my.php?image=pic503hl.jpg)

http://img221.imageshack.us/img221/9615/pic513mt.jpg (http://imageshack.us)

If you want more control over the movement, like controlling in which axis or plane to move, you can use the the icons “X” (shortcut key F5), “Y” (shortcut key F6), “Z” (shortcut key F7), to restrict the movement on those axis, or use “XY” icon and all the plane options from the “XY” icon to restrict the movement on the planes (the shortcut key F8 will cycle through all the plane restrictions) after the element you want to move is selected and the “Select and Move” icon is activated.

http://img221.imageshack.us/img221/401/pic521ep.jpg (http://imageshack.us)

Instead of using the axis and planes restrictions we can use the “Transform Gizmo”, if it is not activated yet you can activate it selecting the menu “Customize” and “Preferences”, it will open the “Preferences Settings” dialog box, select the “Viewports” tab and in the bottom check the “On” in the “Transform Gizmo”. Now you will see a XYZ colored axis when you select something, and now when you put the mouse over one of the axis it will turn orange and if you click and move the mouse the selection will move only on the orange axis direction.

http://img528.imageshack.us/img528/1074/pic820dv.th.jpg (http://img528.imageshack.us/my.php?image=pic820dv.jpg)

You can restrict the gizmo by the planes too, by passing the mouse over the corner of the plane formed by two axis it will turn orange and then you just hold the mouse button and move. Even using the gizmo you can still call the restrictions using the icons or shortcuts.

http://img124.imageshack.us/img124/5457/pic538dt.th.jpg (http://img124.imageshack.us/my.php?image=pic538dt.jpg)

To do a rotation you need not only select the element but define around what it will rotate, it is defined by the icon on the left of the “X” axis restriction icon. The default is “Use Pivot Point Center”, it will rotate using the center point of each element selected, if they are connected they will behave as one big block.

http://img62.imageshack.us/img62/2646/pic543zv.jpg (http://imageshack.us)

But you have more options when clicking on the icon and holding it a little, “Use selection Center”, that will use the center of all the selections as a rotation point, and “Use Transform Coordinate Center”, that will use the pivot of the model as a rotation point, but as it is parented to the big helper on the floor it will be big helper's center, on the 0, 0, 0 coordinate. Once the rotation point is selected, it works the same way as moving, you select the element, select the restriction by using the icons, shortcut, or the gizmo and click move the mouse, it will rotate around the axis/plane selected.

http://img126.imageshack.us/img126/9210/pic551mh.jpg (http://imageshack.us)

To scale the elements you need to specify again define the point around which it will happen, using the same icons we used for the rotation, then you will be able to scale the elements as separated entities using the “Use Pivot Point Center”, approach or keep them away using the “Use selection Center”, or approach or keep them away from the model pivot point using the “Use Transform Coordinate Center”.

http://img175.imageshack.us/img175/487/pic564pc.jpg (http://imageshack.us)

The scaling tool has some options, the default is the “Select and Uniform Scale”, that will scale the same amount to all axis direction, once this option is selected you can not restrict any axis or plane. The “Select and Non-Uniform Scale” that works like restricting one axis, it will scale on only one this axis direction, and you select the axis using the restriction icon, shortcuts or the gizmo . And the “Select and Squash”, that works like restriction on a plane the scale will happens only on the plane directions, and you select which plane by the restriction icon, shortcut or gizmo.

Only by selecting and moving vertex you can make some small changes on the model, and if you do only that without changing the number of vertices you could use Taina's Replacer to export the model to the game. But to make bigger changes as we are going to do here we will need to know some modeling tools, so we are back to the modifier list and the “Selection” parameters.


07-11-2006, 11:20 AM
Bellow the icons there are some selection parameters. When the “By Vertex” is checked means that when you are not using “Vertex” selection, if you select a vertex all the elements around it will be selected too, for example, you are on “Edge” selection and if you click on a vertex all the edges around that vertex will be selected. Remember to deselect it to be able to select only the edges...

http://img188.imageshack.us/img188/4416/pic575nv.jpg (http://imageshack.us)

When the “Ignore Background” is checked you can only select elements that you see, when it is not checked you can select elements that are behind the model too... we will be checking and unchecking this parameter a lot when modeling! The “Hide” and “Unhide All” are very useful too, it will allow you to model more freely without worry with selecting/moving/deleting parts of the mesh by mistake... just select the part of the mesh you don't want to see or manipulate and click the “Hide” button, to turn it back just click the “Unhide All”

The next is “Soft Selection” which we will not use here, when you activate it and select a vertex, all the vertices around it will be selected too, but by different weights that depends of its distance from the vertex selected, and when you move the selected vertex, the others will follow, depending of its weights.

http://img109.imageshack.us/img109/7813/pic584lm.jpg (http://imageshack.us)

Then we have “Edit Geometry”, we will use it a lot for modeling, and because it changes the number of vertices we won't be able to use Taina's Replacer, but MDLops.

Another thing that happens when changing the number of vertices is that some bone information is recalculated and most of times it doesn't work good, but we will be able to fix it.

http://img515.imageshack.us/img515/7884/pic838zx.jpg (http://imageshack.us)

The tools that are enabled and disabled depends of the selection mode we are using, some tools only works for “Vertex” others only for “Edge”. “Create” and “Delete”... well... it creates and deletes elements we are working with. To create a vertex, in the “Vertex” selection, you need just activate the “Create” button and click on the 3d scene.

http://img102.imageshack.us/img102/5049/pic626th.th.jpg (http://img102.imageshack.us/my.php?image=pic626th.jpg)

To create a face in “Face” selection, you need to click on the 3d scene two times to make a triangle, and to create a polygon, in “Polygon” selection, you need to place the last vertex in the the same place as the first to close it, when you are closing a hole on the mesh using a polygon you need to build it anti-clockwise.

http://img336.imageshack.us/img336/2491/pic639ul.th.jpg (http://img336.imageshack.us/my.php?image=pic639ul.jpg)

To delete you first select what you want to delete and click the “Delete” button.

The “Weld” is only enabled when we have vertex selected, it is used to glue vertices together, first we select the vertices we want to glue, then we click “Selected”.

http://img163.imageshack.us/img163/1208/pic663zj.th.jpg (http://img163.imageshack.us/my.php?image=pic663zj.jpg)

f the Weld warning appears it is because the vertices are not within the range of 0,1 that is the default for Gmax.

http://img403.imageshack.us/img403/2824/pic645rd.jpg (http://imageshack.us)

Let's change it to 3, and try again, now our vertices are glued together. Be careful though, it can remove details of the mesh if you don't notice that you have selected them, or put a high value here.

http://img163.imageshack.us/img163/3840/pic650ju.jpg (http://imageshack.us)

http://img243.imageshack.us/img243/6169/pic678tn.th.jpg (http://img243.imageshack.us/my.php?image=pic678tn.jpg)


07-11-2006, 11:30 AM
The “Target” is another way to glue the vertices together, here you have more control of the vertex position, as you will move one vertex over the other, the number beside the “Target” button specify the distance in pixels between the two vertices for they to be glued. So to use it just enable the “Target” button and move one vertice over the other.

http://img302.imageshack.us/img302/2795/pic688ji.th.jpg (http://img302.imageshack.us/my.php?image=pic688ji.jpg)

http://img69.imageshack.us/img69/7168/pic696jd.th.jpg (http://img69.imageshack.us/my.php?image=pic696jd.jpg)

As I said before our new mesh doesn't have all the faces connected, so if we select one vertex and move it there will be another one behind it
And if we move all of them we will end with as many vertices as the number of faces around it.

http://img111.imageshack.us/img111/2643/pic718db.th.jpg (http://img111.imageshack.us/my.php?image=pic718db.jpg)

http://img111.imageshack.us/img111/2720/pic701hx.th.jpg (http://img111.imageshack.us/my.php?image=pic701hx.jpg)

So we need to merge all those vertices together, I've selected all the vertices of the mesh and click the “Selected” button with the range of 0,1, because we want only glue together the overlapping vertices.

http://img111.imageshack.us/img111/1392/pic734yl.th.jpg (http://img111.imageshack.us/my.php?image=pic734yl.jpg)

Once it is done we go to Element to see if it is only one whole mesh. When we select the mesh it appears as one, but if we hide it, using the “Hide” button in the Selection roll-up menu, we see that many faces are left behind, and we can not even select the vertices of those faces... don't know how this happened, but we will need to fix it.

http://img50.imageshack.us/img50/7632/pic749ki.th.jpg (http://img50.imageshack.us/my.php?image=pic749ki.jpg)

http://img50.imageshack.us/img50/5576/pic757bz.th.jpg (http://img50.imageshack.us/my.php?image=pic757bz.jpg)

So what I'm doing here is keep the one element mesh I've just hide, and delete those faces that were left behind, and them fill the holes on the mesh creating new faces. With the Element enabled we select all the faces them press the “Delete” button.

http://img507.imageshack.us/img507/8314/pic766wq.th.jpg (http://img507.imageshack.us/my.php?image=pic766wq.jpg)

http://img290.imageshack.us/img290/3948/pic779ts.th.jpg (http://img290.imageshack.us/my.php?image=pic779ts.jpg)


07-11-2006, 11:32 AM
Now we unhide the mesh pressing the button “unhide” in the Selection roll-out menu.

http://img214.imageshack.us/img214/1259/pic782gj.th.jpg (http://img214.imageshack.us/my.php?image=pic782gj.jpg)

Now with the Face selected and the “Create” button enabled we create faces on all the holes in the mesh, remember to build the faces anti-clockwise.

http://img184.imageshack.us/img184/7081/pic799xy.th.jpg (http://img184.imageshack.us/my.php?image=pic799xy.jpg)

http://img214.imageshack.us/img214/2939/pic809og.th.jpg (http://img214.imageshack.us/my.php?image=pic809og.jpg)

All this should be done with the other meshes too, feets and hands. It appears Lord Spartan and me have some homework to do. :D

That is it for now, next part we will add it to the base mesh, and we will see how to merge pieces of different models together to have a body model, so a little more of modeling.

07-11-2006, 12:54 PM
Ummm... wow. This is an excellent tutorial. Can't wait to read the rest :).

07-15-2006, 02:04 PM
whoops... forgot to post and mention that I had added this second parter to the Sticky :o My bad...

Excellent tutorial so far Kha! :D

08-06-2006, 07:38 PM
Hi again,

Sorry for the long delay, as I have less free time I'll try to post every weekend at least a post.

As I was filling the holes from the robe mesh I've noticed that some faces was modeled with both sides, the inside and outside, so the inside faces should be deleted too, because it will not be seen by the player and the game will have to spend time to render it.

When you create faces in Gmax it only gives the outside face, if you look inside the model the mesh appears to be transparent, you only see the border of the separated elements.

http://img440.imageshack.us/img440/7999/pic84ls2.th.jpg (http://img440.imageshack.us/my.php?image=pic84ls2.jpg)

That is why you have to create it anti-clockwise. If you create a face clockwise it will build the face inside the mesh.

http://img452.imageshack.us/img452/8068/pic86cc5.th.jpg (http://img452.imageshack.us/my.php?image=pic86cc5.jpg)

This is the modeled mesh and the original one from the game and we are looking inside their arms, in the modeled I need to remove all the faces inside, and leave only those that we want to be seen, like those near the glove. And because it will take time we are going to see how to put together pieces of different models.

http://img367.imageshack.us/img367/6863/pic87dx6.th.jpg (http://img367.imageshack.us/my.php?image=pic87dx6.jpg)

3.3 Merging pieces of different models

Jolly Boots asked once how he could remove Atton's jacket and give him the torso of the underwear's male, so that is what I'll explain here in more detail. The first thing I'm going to do is create a folder called “Atton” and using “Kotor Tool” we will extract the files of the male underwear pmbam, and Atton's cloths P_AttonBB:

KotorII->BIFs->models.bif->Aurora Model->pmbam.mdl
KotorII->BIFs->models.bif->Aurora Model Extension->pmbam.mdx

KotorII->BIFs->models.bif->Aurora Model->p_attonbb.mdl
KotorII->BIFs->models.bif->Aurora Model Extension->p_attonbb.mdx

Now using “MDlops” we press the “Select file” button, select pmbam.mdl file and with “Kotor 2” button enabled we press the “Read and write button” we do the same with p_attonbb.mdl file.

Start Gmax using the Nwmax icon, and import the model P_AttonBB-ascii.mdl.

We call the “Select Object” window using the “Select by Name” icon, and now we select all the meshs that have an _g in its name's end.

We name this selection Bones in the text field, and then we hide the selection pressing the right mouse button and selecting the “Hide Selection” from the menu.

We create another selection called Meshes selecting eyeLA, eyeLid, eyeRA, eyeRlid, teethDWN, teethUP, JacketFlapNew, ShirtFlapNew, LArm_Geo, RArm_Geo, Head_Geo, and we hide those too. Then we select all the boxes left and name it Helpers.

Now we select the Meshes selection, say “yes” to the warning window and we will have only the meshes visible. We already have seen all this in my first post of this tutorial.

http://img441.imageshack.us/img441/9563/pic95nf8.th.jpg (http://img441.imageshack.us/my.php?image=pic95nf8.jpg)

One important thing to remember is that the flap of his shirt and jacket will not move any more when we export it to the game using MDlops, if you select the flap you will see that there is an “AuroraFlex” modifier in it, only Taina's Replacer can export it back to the game, but then we will not be able to change the number of vertices of the model. But as we are not going to use his jacket we don't need to worry about it.

http://img421.imageshack.us/img421/3860/pic96yz1.th.jpg (http://img421.imageshack.us/my.php?image=pic96yz1.jpg)

From this model we are going to use only its pants, shoes and belt, the arms and torso will be from the underwear model. Let's take a look on the underwear model to decide which model will be used as a base model, save this file as Attonbb_01.gmax and reset Gmax selecting in the menu “File->Reset” and “yes” in the warning window.

Now import the pmbam-ascii.mdl to Gmax, and create the Meshes, Bones and Helpers selections as we did with Atton's cloths model, for the Meshes selection select only RArm, LArm and Torso meshes, and make only this selection visible... in my model the texture didn't come with the model, in the pmbam-textures.txt file that MDlops created it says I should have used the pmbama01.tga texture and not the pmbamc01.tga that I extracted using Kotor Tool , but as the pmbama01.tga is the asian skin color I'm going to put the pmbamc01.tga texture in the model using Gmax.

http://img244.imageshack.us/img244/2466/pic97iw1.th.jpg (http://img244.imageshack.us/my.php?image=pic97iw1.jpg)

To add the texture we press the “Gmax Material Editor” icon to call the “Material Editor” window.

http://img244.imageshack.us/img244/1740/pic98sa3.jpg (http://imageshack.us)

In the “Material Editor” window we press the “New” button and it will open the “New Material” window, where we select “Standard” and press “OK” button.

http://img152.imageshack.us/img152/5049/pic99ym8.th.jpg (http://img152.imageshack.us/my.php?image=pic99ym8.jpg)

Now we click in the grey color box beside the “Diffuse” name in the “Blinn Basic Parameters” rollout, it will call the “Color Selector” window and we change the color from grey to white.

http://img417.imageshack.us/img417/8323/pic100cx7.th.jpg (http://img417.imageshack.us/my.php?image=pic100cx7.jpg)


08-06-2006, 07:43 PM
Now in the “Maps” rollout we check the “Diffuse Color” and click in the “None” button beside it to call the “gmax Material Navigator”, here we press the “bitmap” and chose the file pmbamc01.tga.

http://img476.imageshack.us/img476/3395/pic101sn7.th.jpg (http://img476.imageshack.us/my.php?image=pic101sn7.jpg)

http://img417.imageshack.us/img417/2698/pic102jr1.th.jpg (http://img417.imageshack.us/my.php?image=pic102jr1.jpg)

http://img98.imageshack.us/img98/9154/pic103te4.th.jpg (http://img98.imageshack.us/my.php?image=pic103te4.jpg)

Now we enable the “Show Map in Viewport” icon and with the mesh torso selected we press the “Apply” button.

http://img176.imageshack.us/img176/2382/pic104ij8.th.jpg (http://img176.imageshack.us/my.php?image=pic104ij8.jpg)

Now we select the arms and press the “Apply” button for each one.

http://img468.imageshack.us/img468/587/pic105vo2.th.jpg (http://img468.imageshack.us/my.php?image=pic105vo2.jpg)

When you export the model the name of the bitmap file we used here will be exported with the model, this is a way to change the name of the model's texture without hexedit the model file. And if you want to change the name of the model you need to select the “Aurara Base” mesh and change its name in the modify rollout. Then you will need to change the name of the original pmbam.mdl and pmbam.mdx files to the name you want before compiling the new ascii file Gmax exported using MDlops.

http://img402.imageshack.us/img402/4623/pic106ty3.th.jpg (http://img402.imageshack.us/my.php?image=pic106ty3.jpg)

To decide which model will be the base I usually use the one with the arm I need, here we want the underwear arms with the pants, shoes and belt from Atton's cloths, so we are going to use the underwear model as a base, because this way we won't need to bone weight the arms, it is already done and working, and weighting the hand and fingers is a tedious work. Let´s save this file as pmbam_01.gmax.

Hope someone is reading all this stuff... any feedback is welcome.

The below has been added in from this (http://www.lucasforums.com/showthread.php?t=163521)thread -- j7

Thanks Jeckel,

This model is not to make Carth look smart, but yummy :drool1: !! Anyway, I'm working on a mod to give Carth different cloths and underwear for Kotor I and II.


Hi Jolly, I'm following you here....

I would do a few different steps from you...

1. Once you have the upper body mesh... I would delete the skin modifier using the trash can in the modifier list with the skin modifier selected, because Atton's bone will mess with the mesh once it is imported to the other file anyway, and then I would save this file:
http://img89.imageshack.us/img89/5787/khafig016ju.th.jpg (http://img89.imageshack.us/my.php?image=khafig016ju.jpg)

2. Reset Gmax and import Atton model, it is not a good idea use the same file because it will import the bones of the underwear model and Atton body model. Now I select the Torso_geo, RArm_Geo, LArm_Geo, JacketFlapNew and ShirtFlapNew, hide everything else and do a Selection Set with those meshes (select everything and give it a name, for example cloths) to make the selection of these meshes easier, if you want you can make selections for bones and another for helpers it is a good idea... if you don't get it take a look in this Uvmap tutorial (http://geocities.yahoo.com.br/ninivekha/Telos/HeadUVRemap.zip) I've done for a friend.
http://img89.imageshack.us/img89/5113/khafig022xa.th.jpg (http://img89.imageshack.us/my.php?image=khafig022xa.jpg)

3. Now using File->Merge the file with the underwear mesh and select the torso.
http://img88.imageshack.us/img88/4536/khafig038by.th.jpg (http://img88.imageshack.us/my.php?image=khafig038by.jpg)

4. Select the Torso_Geo, with editable mesh highlighted in the modifier list select element, enable the attach button and click the underwear mesh.
http://img20.imageshack.us/img20/4789/khafig040xu.th.jpg (http://img20.imageshack.us/my.php?image=khafig040xu.jpg)

5. Torso_geo and underwear is one big mesh now.... unhide all the bones and change the system coordinate from view to local, because I want the bones to rotate using their axis and not the viewport axis.
http://img110.imageshack.us/img110/9590/khafig054lg.jpg (http://imageshack.us)

6. Select all the bones and press CTRL X to make them a little transparent, let's see if the bones are still affecting the mesh...select the bone from the torso,torsoUpr_g, and rotate it around the y axis...you see that the jacket moves but not the underwear mesh... we need add the bone weights for the underwear vertices, press CTRL Z to undo the rotation.
http://img86.imageshack.us/img86/1867/khafig076oe.th.jpg (http://img86.imageshack.us/my.php?image=khafig076oe.jpg)

7. Let's delete Atton's shirt to see his underwear and then we can fix the bone weights...with editable mesh enabled, we highlight element and select all parts of his shirt and delete it, we hide the object ShirtFlapNew too. But before going on it is a good idea model the mesh the way you want it, export it to the game to see if it is at least working without any crash, and then, when all the modeling and texture painting is done we can fix the bones weight.
http://img133.imageshack.us/img133/5183/khafig081nh.th.jpg (http://img133.imageshack.us/my.php?image=khafig081nh.jpg)


8. This is how you can change the bone weights...with the body mesh selected we enable the skin modfier and highlight envelope, in the modifier parameters we will use the bone list, the Abs. Effect in the Weight Properties, and check the Vertices box in the Filters.
http://img100.imageshack.us/img100/8757/khafig093lv.th.jpg (http://img100.imageshack.us/my.php?image=khafig093lv.jpg)

9. When you select a bone in the bone list, some vertices of the mesh is shown in color, this color shows the weight of the selected bone on the vertex, each bone is showed in the mesh as a red line when selected and black line when deselected. The vertex color goes from red (100% weight) to blue (1%) and no color at all (0%). If you checked vertex in the filters, you can select the vertices and they will be shown with a white square around it.
http://img139.imageshack.us/img139/261/khafig109ce.th.jpg (http://img139.imageshack.us/my.php?image=khafig109ce.jpg)

10.To see the bone weight value of one vertex you select the vertex and see the number in the Abs. Effect box, it goes from 0 to 1.000, if you select more than one vertex and they have different values the box will be empty, to give it a value you just need to change the number, and the color of the vertex and the color of the faces around it will change too.
http://img101.imageshack.us/img101/2314/khafig111rx.th.jpg (http://img101.imageshack.us/my.php?image=khafig111rx.jpg)

11. For me the best way to see if the bone's weight is working or not is doing some kind of animation (this animation will not be used by the game)...to do that I hide everything except the bones, then I enable the Animate button and the key button in the bottom panel. With one of the solid bones selected, the bone of the leg for example, I put the time slider to frame 5 and rotate the bone leg 60 degree around the y axis. You will see that a blue key is created at frame 0 and another at frame 5, if you move the time slider you will see the leg bone going up.
http://img92.imageshack.us/img92/8651/khafig124rf.th.jpg (http://img92.imageshack.us/my.php?image=khafig124rf.jpg)

12. After this kind of moviment it is a good idea to put it back to the original position... then I go to frame 10 and copy the key at frame 0, hold the SHIFT key while moving the key from frame 0 to 10.
http://img88.imageshack.us/img88/8022/khafig136tj.th.jpg (http://img88.imageshack.us/my.php?image=khafig136tj.jpg)

13. I do this for all the possible movement of the body, moving the respective bone around all the possible axis.... when it is done I disable the animation button, hide the bones and unhide my body mesh. Now moving the time slider we can see the mesh deformation for each moviment... here we have a big hole in the mesh while the leg goes up....
http://img137.imageshack.us/img137/7324/khafig148ic.th.jpg (http://img137.imageshack.us/my.php?image=khafig148ic.jpg)

14. To fix that we select the Skin modifier, highlight envelop and select the bone of the leg in the bone list, select the vertex that is not in the place it should and change its value in the abs. effect, the vertex will change its color and go to the position indicated by the value you typed. It is a tedious work...but give nice results.
http://img95.imageshack.us/img95/1722/khafig152kd.th.jpg (http://img95.imageshack.us/my.php?image=khafig152kd.jpg)

I've written too much for now, sorry for misspelings.... if you have any further questions let me know..
Good luck!

08-16-2006, 01:44 PM
Hope someone is reading all this stuff... any feedback is welcome.
I am and loving every addition you make to it... :D

I added this last series of instructions to your Tutorial in the stickies..

Just thought I'd let you know that we do indeed appreciate you providing this great tutorial... :thumbsup:

please continue on with it (at your convenience of course).. and we'll make sure it gets archived so you don't have to worry about database/hardrive failure. :eek:

07-03-2010, 05:38 PM
I know this is a really old thread that I'm resurecting (sorry), but it seems to stop right when it starts talking about bone weights. I did some searching, and Kha did explain weighting, but it was in another thread. See this one here for more info:

perhaps a moderator could add the relevant posts to Kha's Merging Models Tutorial (http://www.lucasforums.com/showthread.php?t=167221)? At least posts #11 & 12?

07-04-2010, 07:01 AM
I know this is a really old thread that I'm resurecting (sorry), but it seems to stop right when it starts talking about bone weights. I did some searching, and Kha did explain weighting, but it was in another thread. See this one here for more info:

perhaps a moderator could add the relevant posts to Kha's Merging Models Tutorial (http://www.lucasforums.com/showthread.php?t=167221)? At least posts #11 & 12?

I've added the above posts into this (http://www.lucasforums.com/showpost.php?p=2144990&postcount=24) (post 24) above -- j7