JCarter426 Posted April 25, 2016 Share Posted April 25, 2016 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: In your modeling program, import your head template model (mine is JC_DuH01). Import geometry only. Select all objects and use Tools -> Rename Objects to give the models a unique prefix (I go with "HEAD_"). 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. 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"). 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. 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. This will bring up a new window. 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. Delete. 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. 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). Again, this might not appear to be doing anything, so check the objects' names to make sure you aren't doing it repeatedly. 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. Then we're going to link the head geometry to the Aurora base. Select both. 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. 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. I've opened up the original body model for reference: 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. Repeat that process for the next row, which is 50/50. 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. 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. 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. Then, run the ASCII model through MDLOps. 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. After a bit of 2DA work (or in my case, some lazy trickery) we have a fully functioning model in game. 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.