Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Another way to mesh bodies.

Page: 1 of 1
 VarsityPuppet
06-01-2010, 1:13 AM
#1
Meshing bodies for Dummies

by VarsityPuppet

I don't claim to be any sort of advanced modeler, half the time I don't know what I'm doing myself. I'm just a lazy guy who figures out other ways to do stuff without even learning the basics.


I also would like to apologize in advance for the very little effort I put into making this. There's a reason I don't write tutorials, and that is because I hate formatting forum text to make it look presentable.


Tools you'll need

mdlops (5 or later.. I just use 6)
Notepad
KotorTool


A word of caution -

I am not here to teach you how to model from scratch. If you want a good tutorial, search this section for what you want.

I did however, find this tutorial helpful in actually trying to combine meshes.

http://www.lucasforums.com/showthread.php?t=167221)

http://www.lucasforums.com/showthread.php?t=193050)


Now, A bit of Reading

Before I explain how to do this, I should probably explain how I perceive that these models seem to work.


Most models consist of a bunch of meshes, or 3D objects, that contain some information or another on making the model work.

I won't go into detail, but basically they can be divided into 3 categories: helpers, bones and skins.


Helpers just help indicate where stuff goes. When you equip a lightsaber for instance, a helper shows where to put that saber on the model (in this case, your right or left hand)

Bones, are in essence, just that: bones. They are magically connected to a seperate mdl file which contains all of the animations. Don't worry about it... that's just how it is. You don't see them in-game, but they are there :)

Skins on the other hand, are quite visible and such is the point. Skins are connected to the bones by weighting their vertices to various bones. When the arm bone moves in a punching motion, the skin will deform as necessary to follow the bones accurately. This is how most animations are displayed the way they are.


For the lazy readers:

As bones move, the skin moves with the bones so long as it is connected.



Next point: some models have more bones than others. Take for instance the Jedi robe model: it has that flowing cape section as opposed to say... the Heavy armor... which has all the same bones minus the cape part of course.


For the lazy readers:

Models with more bones is better.



Choosing your models:

First and foremost, choose which models you want to combine.

For the sake of example, we'll be combining some armor model and the padawan robe model. For the male of course because I'm sexist :P (jk)


- Extract your resources

So go to K2 - bif - models

extract PMBIM.mdl, PMBIM.mdx, PMBGM.mdl AND PMBGM.mdx (These are the padawan robes and the Heavy armor models, respectively)


then go to k2 - erfs - TexturePacks - swpc_tex_tpa

Extract PMBI01 and PMBG01 (these are the textures that are displayed on these models.


When you extract these files by the way, you'll want to put them all in the same folder, whatever you decide to name it.


If you are using another set of models, I trust that you know in advance which models they are and what textures they use.


- MDLOPS

Open up whatever version of mdlops you have and decompile both of the models you have in your folder.


- Open Gmax

Open the file in gmax with the nwnmax loader.

Import PMBGM first. This one has some of the skins we need, but not all of the bones we need. We just need to see which skins we want, and how it is divided.

http://i.imagehost.org/t/0537/step1.jpg) (http://i.imagehost.org/view/0537/step1)


From the looks of things, it seems this model has 3 seperate skins: 2 arms and then the rest of the body. You're going to need to apply some critical thinking here. Which skins are you going to need?


http://i.imagehost.org/t/0282/step2.jpg) (http://i.imagehost.org/view/0282/step2)

Well, I want the armor torso and legs to show up, so that's a must, but also I'm going to need the arms as they also contain the hands I need.


minimize gmax for now.

Go to your folder and open up the pmbgm-ascii.mdl and pmbim-ascii.mdl.

In pmbgm-ascii, hit Ctrl+F to bring up the find dialog box. Type in "skin". Hit enter.

http://h.imagehost.org/t/0957/step3.jpg) (http://h.imagehost.org/view/0957/step3)

This should, ideally bring you to the first skin mesh in the model. Torso? That looks promising.

In the line just below it, it says "Parent PMBGM". Change PMBGM to PMBIM. We'll be copying it over into the other notepad file.


You'll want to add it to the end of the file. Just refer to the picture.

http://i.imagehost.org/t/0526/step4.jpg) (http://i.imagehost.org/view/0526/step4)

Now, do this as many times as necessary to import all of the skins that you need. Don't forget to change the "Parent xxxxx" to the correct model, otherwise, when you import it into gmax, it won't be linked and you'll probably get errors.

Also, make sure you replace the headhook dummy in PMBIM with the PMBGM mesh. We're going to be using the torso for the Heavy armor, so we want the head to show up in the right place... and that might not be the case if we use the headhook for the jedi model.


Occasionally, you'll get an error when you import the model and it is crucial that you fix this. This is usually caused by a missing bone.



If you want to find out which bone is missing, you'll have the check the text you copied over. Under each section, there is a subsection called "weights" If you scroll down from there, it will start listing the vertex weights and which bones they are attached to. The importer will crash if there is a bone missing, so you just have to find the first instance of a missing bone, and add it in... even if you don't need it later.


The bones stopped importing at the lfootT_g trimesh, so just look for the first trimesh that isn't there after that in the ascii file.



Hmmm, looks like we forgot to import neck_g


http://i.imagehost.org/t/0379/step6.jpg) (http://i.imagehost.org/view/0379/step6)

After you copy over neck_g into the ascii, it's time to try again.


Before you do that, check to see what it's parent is. If it doesn't exist in the PMBIM-ascii file, you'll need to copy that over.



Reload Gmax and try to import the mdl again.



Fortunately it worked this time, so we are in business.

http://i.imagehost.org/t/0909/step8.jpg) (http://i.imagehost.org/view/0909/step8)


First and foremost, let's get rid of these bones. Select all of the skinned object (use Ctrl + left-click to add to your selection). When you are satisfied with your collection, right click and select "Hide unselected".

http://i.imagehost.org/t/0225/step9.jpg) (http://i.imagehost.org/view/0225/step9)

It looks a little messy as is, but our job is to fix that.

http://i.imagehost.org/t/0171/step10.jpg) (http://i.imagehost.org/view/0171/step10)

By the way, I messed up on my own tutorial, which would explain why those partially seen red gloves are there now.



First: delete the skins you don't want. Be careful about doing this: some skins can expand quite a large area, so be ready to Edit -> Undo a lot of your actions.


To make this easy, I'll just show what needs to be deleted.

http://a.imagehost.org/t/0666/step11.jpg) (http://a.imagehost.org/view/0666/step11)

If you look close, you'll notice the black gloves and the apron thingy are gone. We have no use for those at this point.


All of the meshes that are left, we're going to need some part of those later.

http://i.imagehost.org/t/0888/step12.jpg) (http://i.imagehost.org/view/0888/step12)

Pull Torso_Geo aside using the moving gizmo. Take note of exactly where it was, so you can move it back when you're done. You'll see that it is quite a large mesh. While that is selected, click Editable Mesh, and select vertices. It's time to delete some verts, but I should mention, that UNDER NO CIRCUMSTANCES ARE YOU TO MOVE ANY VERTICES AT THIS POINT.

http://i.imagehost.org/t/0507/step14.jpg) (http://i.imagehost.org/view/0507/step14)

Once you've deleted all of the verts that you want, move it back to its original position, after unclicking the Editable Mesh modifier.




Ah, it's starting to take form.

http://i.imagehost.org/t/0536/step15.jpg) (http://i.imagehost.org/view/0536/step15)


Next, you'll have to trim away at the arms. In this scenario, I want to keep those red gloves, but not the rest of the arm. The solution, is of course to DELETE VERTS!


http://i.imagehost.org/t/0091/step16.jpg) (http://i.imagehost.org/view/0091/step16)


Hide the robe arms and delete away the verts on the arms you don't want. Make sure you leave enough intact so that the gloves don't show any holes in them when combined with the robe arm mesh.


http://i.imagehost.org/t/0838/step17.jpg) (http://i.imagehost.org/view/0838/step17)

Unhide the arm meshes, and it's looking pretty good, no? If we were to import this into the game at this point, it would look pretty decent, but there are some things that might clip through the upper section of the robe.

http://j.imagehost.org/t/0101/step18.jpg) (http://j.imagehost.org/view/0101/step18)


To be on the safe side, you could delete some verts on the armor skin mesh. I usually delete the whole back, because it's easier that way and you won't see it anyways.

http://i.imagehost.org/t/0312/step19.jpg) (http://i.imagehost.org/view/0312/step19)



Make sure you didn't inadvertently delete any vertices and export the model. You'll want to change the UV map of course, otherwise, the robe will not show up nearly as clean in-game. Unfortunately, the UV mapping is for another time.


Semi-final gmax product

http://i.imagehost.org/t/0410/step20.jpg) (http://i.imagehost.org/view/0410/step20)



Recompile it with mdlops and throw it in your override folder.


In-game:

http://i.imagehost.org/t/0995/step21.jpg) (http://i.imagehost.org/view/0995/step21)



That's more or less how it goes. Mine will look different than yours for now, because I had to fix the UVMap, which honestly is a lot of work in itself. (Reforming the entire texture).



After you've exported your model and saved the ascii somewhere safe, you can move around some vertices so you can run it through Taina's replacer. Just make sure that you do NOT DELETE ANY VERTICES OR MESHES. Check for a tutorial on how to run through that effectively. Basically, it will involve you needing two different ascii models, but that is for another time.


I'm sure I'll have to update this tutorial as I really did give it only like 13% effort, but my main goal was to get this down at least.

Enjoy. If any have anything to add, feel free.
Page: 1 of 1