lfnetwork.com mark read register faq members calendar

Thread: Merging Models Tutorial
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-06-2006, 07:39 PM   #1
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
Merging Models Tutorial

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.



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



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.



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.



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



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.



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.



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.



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.



continue....


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-06-2006, 07:54 PM   #2
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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.



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.



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.



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.



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.



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.



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.



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.



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.



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



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


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-06-2006, 08:02 PM   #3
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169



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.



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.




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.



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.



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



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


"Who we are depends on who we create ourselves to be."

My Kotor Mods

Last edited by Kha; 07-06-2006 at 08:57 PM.
Kha is offline   you may: quote & reply,
Old 07-06-2006, 11:29 PM   #4
EnderWiggin
Sine Amore Nihil Est Vita
 
EnderWiggin's Avatar
 
Join Date: Jul 2004
Location: Pennsylvania
Posts: 3,395
Forum Veteran LF Jester 
Well, I think you just earned a spot in the Modeling Tutorial Subforum.

Very nice work... this is impressive.

_EW_



Hello, Pot? This is Kettle. You're black. ~ Prime

Yes, I hate you.

J7 - thanks for accepting me as part of the 'family.'
EnderWiggin is offline   you may: quote & reply,
Old 07-07-2006, 01:40 AM   #5
Lit Ridl
Junior Member
 
Lit Ridl's Avatar
 
Join Date: May 2006
Location: Moscow, Russia
Posts: 437
Hey!
Who will add this to tutorials section???
Add it, please!!!!
It is nice work!!!
Lit Ridl is offline   you may: quote & reply,
Old 07-07-2006, 03:17 AM   #6
ChAiNz.2da
Brony 4 Life. Yo.
 
ChAiNz.2da's Avatar
 
Join Date: Oct 2004
Location: Tennessee (USA)
Posts: 6,847
Quote:
Originally Posted by Kha
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

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


"Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines"


| Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd |
ChAiNz.2da is offline   you may: quote & reply,
Old 07-07-2006, 06:30 AM   #7
Pavlos
Scruffy Englishman
 
Pavlos's Avatar
 
Join Date: Sep 2005
Location: The real world/ivory towers
Posts: 1,974
Current Game: Viking Warrior Poets
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 !
Pavlos is offline   you may: quote & reply,
Old 07-07-2006, 11:17 AM   #8
Darkkender
Knight of Holowan
 
Darkkender's Avatar
 
Join Date: Aug 2004
Location: In the mountains of Oregon
Posts: 2,953
Current Game: Star Wars The Old Republic
Veteran Modder 
Thank you for this Kha I have a feeling I will have some great use for this in the near future.


Working so, we will learn history as a tree knows it; we will climb into shapes printed in the seed; we will become time made visible, years made fragrant; we will make of concentric memory a stem of praise; we will inhabit daylight at a trees own speed; we will be travelers who remain, patriots to this ground.
OMG I only rank 62.13018% geek or a Extreme Geek as it is referred to on the geektest at Geektest
[TSL]Holowan Plugin
Darkkender is offline   you may: quote & reply,
Old 07-07-2006, 01:41 PM   #9
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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.


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-07-2006, 02:22 PM   #10
jaredhimself31
Rookie
 
jaredhimself31's Avatar
 
Join Date: Oct 2005
Location: Some where I Belong
Posts: 49
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??


I am a certified Jesus Freak!!!!!!!
jaredhimself31 is offline   you may: quote & reply,
Old 07-07-2006, 06:38 PM   #11
Arátoeldar
Flame Imperishable
 
Arátoeldar's Avatar
 
Join Date: Nov 2003
Location: Karningul
Posts: 1,574
Great work Kha. I can't wait for part 2.


Not all those who wander are lost.-J.R.R. Tolkien

I believe in Christianity as I believe the sun has risen, not only because I see it but by it I see everything else - C.S. Lewis
Arátoeldar is offline   you may: quote & reply,
Old 07-07-2006, 09:35 PM   #12
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
Quote:
Originally Posted by jaredhimself31
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


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-07-2006, 10:08 PM   #13
LORD SPARTAN
Rookie
 
LORD SPARTAN's Avatar
 
Join Date: Mar 2005
Location: From a red sun solar system
Posts: 249
Current Game: KotOR, Skyrim, Dragon Age
This is solid gold Kha, thank you very much.
I'll wait patiently for part 2.


BEFORE HOPE COMES DARKNESS!!!
LORD SPARTAN is offline   you may: quote & reply,
Old 07-08-2006, 02:16 AM   #14
oldflash
Veteran
 
oldflash's Avatar
 
Join Date: Aug 2004
Posts: 904
Current Game: SWtOR
Forum Veteran Veteran Modder Helpful! 
Quote:
Originally Posted by jaredhimself31
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.


"If you must sleep on the same bed, at least try to dream different dreams".
oldflash is offline   you may: quote & reply,
Old 07-11-2006, 10:45 AM   #15
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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.



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.



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.



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



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.



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.



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



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.



continue....


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-11-2006, 10:58 AM   #16
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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.



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.



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.



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.



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.



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.



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.



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


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-11-2006, 11:10 AM   #17
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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.



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.





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.



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.



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.



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.



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.



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



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


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-11-2006, 11:20 AM   #18
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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...



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.



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.



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.



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.



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



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



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.





continue...


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-11-2006, 11:30 AM   #19
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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.







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.





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.



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.





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.





continue...


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-11-2006, 11:32 AM   #20
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
Now we unhide the mesh pressing the button “unhide” in the Selection roll-out menu.



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.






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

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.


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 07-11-2006, 12:54 PM   #21
Pavlos
Scruffy Englishman
 
Pavlos's Avatar
 
Join Date: Sep 2005
Location: The real world/ivory towers
Posts: 1,974
Current Game: Viking Warrior Poets
Ummm... wow. This is an excellent tutorial. Can't wait to read the rest .
Pavlos is offline   you may: quote & reply,
Old 07-15-2006, 02:04 PM   #22
ChAiNz.2da
Brony 4 Life. Yo.
 
ChAiNz.2da's Avatar
 
Join Date: Oct 2004
Location: Tennessee (USA)
Posts: 6,847
whoops... forgot to post and mention that I had added this second parter to the Sticky My bad...

Excellent tutorial so far Kha!


"Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines"


| Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd |
ChAiNz.2da is offline   you may: quote & reply,
Old 08-06-2006, 07:38 PM   #23
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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.



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



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.



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.



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.



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.



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



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.



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.



continue...


"Who we are depends on who we create ourselves to be."

My Kotor Mods
Kha is offline   you may: quote & reply,
Old 08-06-2006, 07:43 PM   #24
Kha
Rookie
 
Kha's Avatar
 
Join Date: Oct 2005
Location: Brazil
Posts: 169
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.








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



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



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.



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 !! 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:


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.



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


4. Select the Torso_Geo, with editable mesh highlighted in the modifier list select element, enable the attach button and click the underwear mesh.


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.



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.


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.


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.


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.


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.


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.


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.


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


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.


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


"Who we are depends on who we create ourselves to be."

My Kotor Mods

Last edited by jonathan7; 07-04-2010 at 07:00 AM.
Kha is offline   you may: quote & reply,
Old 08-16-2006, 01:44 PM   #25
ChAiNz.2da
Brony 4 Life. Yo.
 
ChAiNz.2da's Avatar
 
Join Date: Oct 2004
Location: Tennessee (USA)
Posts: 6,847
Quote:
Originally Posted by Kha
Hope someone is reading all this stuff... any feedback is welcome.
I am and loving every addition you make to it...

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

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.


"Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines"


| Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd |
ChAiNz.2da is offline   you may: quote & reply,
Old 07-03-2010, 05:38 PM   #26
redrob41
Veteran
 
redrob41's Avatar
 
Join Date: Jul 2007
Location: Edmonton
Posts: 932
Current Game: just modding TSL
Veteran Modder Helpful! 
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:
http://www.lucasforums.com/showthread.php?t=163521

perhaps a moderator could add the relevant posts to Kha's Merging Models Tutorial? At least posts #11 & 12?



- Major character artist for the Revenge of Revan mod. -
- List of Completed Mods - Work in Progress Thread - Skinning Tutorial -
redrob41 is offline   you may: quote & reply,
Old 07-04-2010, 07:01 AM   #27
jonathan7
Exiled Jedi...
 
jonathan7's Avatar
 
Status: Moderator
Join Date: Jun 2006
Location: Ivory Tower
Posts: 3,676
Contest winner - Modding LFN Staff Member Veteran Modder Helpful! 
Quote:
Originally Posted by redrob41 View Post
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:
http://www.lucasforums.com/showthread.php?t=163521

perhaps a moderator could add the relevant posts to Kha's Merging Models Tutorial? At least posts #11 & 12?
I've added the above posts into this (post 24) above -- j7



"Love is the only reality and it is not a mere sentiment. It is the ultimate truth that lies at the heart of creation." - Rabindranath Tagore

"Many a doctrine is like a window pane. We see truth through it but it divides us from truth." - Kahlil Gibran
jonathan7 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Merging Models Tutorial

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:18 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.