Jump to content

Home

Merging heads and bodies


Recommended Posts

This tutorial will go over the process of merging a head and body into one model, as well as loading animations onto the new model.

 

I'll note that at the time I'm writing this, I have only done this for Knights of the Old Republic II: The Sith Lords. But I believe the process is the same for the first game.

 

Tools you will need:

  • KOTOR Tool
  • MDLOps 0.7a2 (or later)
  • a 3D modeling program that supports NWMax (such as 3ds Max or Gmax)
  • NWMax

 

First, extract all the models you'll be using, as well as their textures. I'm going to be making a Mandalorian Duros in this example example, so for the head I will be using JC_DuH01 (which is a head I created in my last tutorial), for the body I will be using PMBHM, and I also want to give him the unique Mandalorian animations from N_Mandalorian. Put everything in a folder somewhere, then run the models through MDLOps to convert them to ASCII.

 

Here's what my stuff looks like so far:

 

Merging%20Tutorial%201_zpsudqkqguz.png

 

In your modeling program, import your head template model (mine is JC_DuH01). Import geometry only.

 

Merging%20Tutorial%202_zpscxczhmix.png

 

Select all objects and use Tools -> Rename Objects to give the models a unique prefix (I go with "HEAD_").

 

Merging%20Tutorial%203_zpsqsh9jtel.png

 

This might not appear to do anything, but if you check the model names you'll see they've changed. Once they have, save the project.

 

In a new project, import your body model (mine is PMBHM). Again, import geometry only.

 

Merging%20Tutorial%204_zpsf34svqzv.png

 

If your body model lacks textures, as mine does, you will have to apply them through the material editor. Set the Diffuse map to Bitmap, then choose your texture file, and then apply the material to the model's geometry (typically "Torso", "LArm", and "RArm").

 

Merging%20Tutorial%205_zpsmdsjdeui.png

 

Also, you have to click the checkered button to Show Map in Viewpoint. And it's a good idea to give the material a name to keep track of your materials (I always use the file name).

 

Now is a good time to save.

 

With this project still open, go to File -> Merge and import everything from your head project (mine was Duros Head). You should see your head at the body's feet.

 

Merging%20Tutorial%206_zpsyvhve6gj.png

 

Now, save this as a new project, so you don't end up rewriting your body template.

 

With the head's Aurora base selected (mine is HEAD_JC_DuH01), click on the Align tool. Then use Select By Name to pick the headhook.

 

Merging%20Tutorial%207_zpsswvherqi.png

 

This will bring up a new window.

 

Merging%20Tutorial%208_zpsus2uykje.png

 

Make sure both position and orientation are selected for X, Y, and Z, and then hit OK. After that, the head will be in the correct position. That might seem like a lot of steps, but trust me, it's much easier than trying to do it yourself.

 

This is where it gets complicated.

 

The head and body have some objects in common. The reason we went through all that renaming and merging nonsense is because if we hadn't, when NWMax imported the models it would've seen two objects with the same name and that would confuse it. Don't make NWMax confused. You wouldn't like NWMax when it's confused.

 

So now what we need to do is delete objects so there's only one copy of each thing. But do we delete the head's or the body's? Well, the rule of thumb is you delete whatever doesn't have geometry weighted to it. Weigting vertices is a pain, so the less you can do the better. This will depend on what models you're using, but in this case easiest course of action is to delete the neck bones in the body model and then delete everything upstream from the neck bones in the head model. Also delete the head's extra ignore_NGon01.

 

Merging%20Tutorial%209_zpsgoddcuw7.png

 

Delete.

 

Merging%20Tutorial%2010_zpso57wcz9m.png

 

Delete.

 

Now that we have one copy of everything, we need to restore the names to their original state. First, select all the head objects.

 

Merging%20Tutorial%2012_zpsdnojqbxq.png

 

And then use the Rename Objects tool again, this time removing the first X number of characters to erase your prefix (mine was "HEAD_", so that's 5 characters).

 

Merging%20Tutorial%2013_zpshs8ozxnr.png

 

Again, this might not appear to be doing anything, so check the objects' names to make sure you aren't doing it repeatedly.

 

Merging%20Tutorial%2014_zpskjqspxjh.png

 

Unfortunately, this destroys some of the weighting. We'll have to fix that in a moment. But first, let's link everything up the way it's supposed to be. The bones have to be linked in a certain way so they all move together in the correct manner. Additionally, all geometry has to be linked to the Aurora base or else it won't export.

 

First select necklwr_g. We're going to link it to torsoUpr_g with the Select and Link tool.

 

Merging%20Tutorial%2015_zpsoe26qyzg.png

 

Merging%20Tutorial%2016_zpsom6dnsh3.png

 

Then we're going to link the head geometry to the Aurora base. Select both.

 

Merging%20Tutorial%2017_zpsqh2xpah2.png

 

If your head has other geometry - for example, the tongue - select that as well.

 

And we need to use NWMax's linking tool this time, Fast Linker.

 

Merging%20Tutorial%2018_zpsoxajil7b.png

 

Now we can fix the weighting. Assuming you have to, anyway. If the model isn't weighted to the neck - for example, PFBBM isn't - then you won't have to. But for this one we do.

 

Select the torso and under the Skin modifier, add the bone neck_g.

 

Merging%20Tutorial%2019_zpsx59qy4r4.png

 

I've opened up the original body model for reference:

 

Merging%20Tutorial%2020_zpswzalrzbf.png

 

We need to get the new model's neck vertices to look like that. In this case, there are two rows that have the same values. The top row is weighted 75% to neck_g and 25% to torsoUpr_g. So we just copy those values.

 

Merging%20Tutorial%2021_zpsffkt0xca.png

 

Merging%20Tutorial%2022_zpsks1wrrp3.png

 

Repeat that process for the next row, which is 50/50.

 

Merging%20Tutorial%2023_zpsf1cpchj9.png

 

Merging%20Tutorial%2024_zps2igqu6yd.png

 

That wasn't so bad, was it?

 

If we've done everything right, the model is now set up as a full body model. The head is now just part of the model. This means we can do things like import animations, and they'll apply to both body and head.

 

Merging%20Tutorial%2025_zpsfhul0nac.png

 

Merging%20Tutorial%2026_zpsknazzixo.png

 

Here I've imported the animations from the armored Mandalorian model. I leave the supermodel as S_Female02, meaning the model will still use the rest of the usual animations; only the two idle animations present on the model will be different.

 

If you want to get it back into the game, make sure you've given your model's Aurora base a unique name (the one I chose is "JC_MandDuros01") and then Export Model+Anim to your folder.

 

Merging%20Tutorial%2027_zpsl38wfnpr.png

 

Add "-ascii" to the end of the name of the file you extracted.

 

You also need to set the "original" model for MDLOps. This means copying an existing binary model and giving it the same name as your new model, without the "-ascii" extension. For best results, you should use a full body model. I decide to use the Handmaiden's model, P_HandmaidenBB. So, I rename the ASCII model I extracted from 3ds Max to JC_MandDuros01-ascii.mdl and I rename the Handmaiden's model to JC_MandDuros01.mdl / N_MandDuros01.mdx. It's important to do this renaming so MDLOps gets the animations and lips right.

 

Merging%20Tutorial%2028_zpsnf2a3ldl.png

 

Then, run the ASCII model through MDLOps.

 

Merging%20Tutorial%2029_zpslgwzefea.png

 

MDLOps gave me some nonsense about overlapping verticies, but I'm going to ignore that.

 

You should have two new files, which you can remove from this folder, and rename to remove the extensions generated by MDLOps.

 

Merging%20Tutorial%2030_zps511mnbhq.png

 

After a bit of 2DA work (or in my case, some lazy trickery) we have a fully functioning model in game.

 

Merging%20Tutorial%2031_zpsnflxt8yo.png

 

It's usually more convenient to keep heads and bodies separate, but sometimes you need it all in one model. So now you can go mix and match models however you want. Good luck!

 

If you have any questions or comments, you can reply in the discussion thread here.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...