Jump to content

Home

Merging Models Tutorial


Kha

Recommended Posts

Hi,

 

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:

http://kotortool.starwarsknights.com/

 

2.MDLops by Cchargin:

http://home.comcast.net/~cchargin/kotor/

 

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

http://www.turbosquid.com/gmax

 

4.Nwnmax for Gmax:

http://nwmax.dladventures.com/

 

5.Taina's Replacer:

http://www.pcgamemods.com/mod/11335.html

 

 

 

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.

 

pic019yd.th.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

 

pic029ha.th.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.

 

pic039dt.th.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.

 

pic048gk.th.jpg

 

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

 

pic072ns.th.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.

 

pic086yi.th.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.

 

pic107ri.jpg

 

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.

 

pic128kx.th.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.

 

pic118zg.th.jpg

 

continue....

Link to comment
Share on other sites

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.

 

pic262aj.jpg

 

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.

 

pic272wq.jpg

 

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.

 

pic148oj.jpg

 

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.

 

pic150jb.th.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.

 

pic168hr.jpg

 

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.

 

pic172wn.th.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.

 

pic187um.jpg

 

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.

 

pic282nd.jpg

 

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.

 

pic295aq.jpg

 

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”.

 

pic197nj.th.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.

 

continue....

Link to comment
Share on other sites

pic216gm.jpg

pic234ta.jpg

 

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.

 

pic308bi.jpg

 

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.

 

pic254pb.jpg

 

 

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.

 

pic313yj.th.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.

 

pic329fd.th.jpg

 

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

 

pic331yd.th.jpg

 

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

pic359kt.jpg

 

And in the next 3DS Import warning click no.

 

pic375ke.jpg

 

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.

 

pic384ha.th.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.

 

pic391hj.jpg

 

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.

 

pic401kb.th.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.

 

pic414hr.jpg

 

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.

 

pic427ao.jpg

 

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.

 

pic438ur.th.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”.

 

pic443xe.jpg

 

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.

 

pic451zb.jpg

 

continue....

Link to comment
Share on other sites

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.

 

pic464nq.th.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.

 

pic475uh.th.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.

 

pic483ny.th.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.

 

pic492el.th.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.

 

pic611cj.th.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.

 

pic594xp.th.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.

 

pic609pa.th.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.

 

continue...

Link to comment
Share on other sites

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.

 

pic818lt.jpg

 

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.

 

pic503hl.th.jpg

 

pic513mt.jpg

 

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.

 

pic521ep.jpg

 

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.

 

pic820dv.th.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.

 

pic538dt.th.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.

 

pic543zv.jpg

 

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.

 

pic551mh.jpg

 

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”.

 

pic564pc.jpg

 

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.

 

continue...

Link to comment
Share on other sites

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...

 

pic575nv.jpg

 

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.

 

pic584lm.jpg

 

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.

 

pic838zx.jpg

 

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.

 

pic626th.th.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.

 

pic639ul.th.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”.

 

pic663zj.th.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.

 

pic645rd.jpg

 

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.

 

pic650ju.jpg

 

pic678tn.th.jpg

 

continue...

Link to comment
Share on other sites

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.

 

pic688ji.th.jpg

 

pic696jd.th.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.

 

pic718db.th.jpg

 

pic701hx.th.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.

 

pic734yl.th.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.

 

pic749ki.th.jpg

 

pic757bz.th.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.

 

pic766wq.th.jpg

 

pic779ts.th.jpg

 

continue...

Link to comment
Share on other sites

Now we unhide the mesh pressing the button “unhide” in the Selection roll-out menu.

 

pic782gj.th.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.

 

pic799xy.th.jpg

 

pic809og.th.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.

Link to comment
Share on other sites

  • 4 weeks later...

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.

 

pic84ls2.th.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.

 

pic86cc5.th.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.

 

pic87dx6.th.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->ERFs->TexturePacks->swpc_tex_tpa.erf->P->pmbamc01.mdx

 

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

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

KotorII->ERFs->TexturePacks->swpc_tex_tpa.erf->P->p_attonba01.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.

 

pic95nf8.th.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.

 

pic96yz1.th.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.

 

pic97iw1.th.jpg

 

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

 

pic98sa3.jpg

 

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.

 

pic99ym8.th.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.

 

pic100cx7.th.jpg

 

continue...

Link to comment
Share on other sites

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.

 

pic101sn7.th.jpg

 

pic102jr1.th.jpg

 

pic103te4.th.jpg

 

 

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

 

pic104ij8.th.jpg

 

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

 

pic105vo2.th.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.

 

pic106ty3.th.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 thisthread -- 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:

khafig016ju.th.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 I've done for a friend.

khafig022xa.th.jpg

 

 

3. Now using File->Merge the file with the underwear mesh and select the torso.

khafig038by.th.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.

khafig040xu.th.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.

khafig054lg.jpg

 

 

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.

khafig076oe.th.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.

khafig081nh.th.jpg

 

continue....

 

 

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.

khafig093lv.th.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.

khafig109ce.th.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.

khafig111rx.th.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.

khafig124rf.th.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.

khafig136tj.th.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....

khafig148ic.th.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.

khafig152kd.th.jpg

 

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

Good luck!

Kha

Link to comment
Share on other sites

  • 2 weeks later...
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:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...