Okay, I thought (and people requested
) that I'd share how I changed animations between models. I went through a lot of trial and error to get to this procedure, as there aren't many tutorials at all on this topic, but I'm sure some easier shortcuts and ways to refine it may be found; however, this is how I've managed to get it to work so far. Let me know if you find a better way. This works for both the original KotOR and TSL. Note that this is not creating animations, or replacing/adding some animations, but replacing all
of the animations on a model. Now that I've had my little monologue, let's get to work.
What you'll need:
(Modeling program of your choice. I use gmax because it's free, but it should be basically the same in 3dsmax.)
And the NWMax plugin
Recommended: KotOR Save Game Editor
Patience and some spare time
Save your models often, and with different names. If you mess up, or gmax messes up your files (I've had it happen), it's nice not to have to start over.
Here's an overview of what I believe we're doing. There are six 'super models' in the game for humanoid models, but in the end they all connect to one, 's_male01'. The super models contain all the animations you can use, or at least that the PC uses. Most of the other models use these models' animations. Actually, their bones do. Their skin is weighted to follow the bones. However, some models have their own animations stored in their own model instead, such as HK-47 and Nihilus, as well as all creatures. For example, HK-47 was made to move robotically, so the programmers gave him his own set of animations, and deemed it unnecessary to give him melee animations. My mod put his skin over a Wookiee's bones and gave him melee animations, but you may notice that he moves more like a Wookiee than a droid as a consequence.
SMAT: Part 1: Prep
Alright, let's get started. First you need to find your models. You need the model you want to put animations on, and one model with all the animations already on it. If the model you want animations on is an only body model (no head on it), you should extract a player body, like clothing or an armor. This ensures that you can change clothing/heads on the model. To make it easy, let's use PMBAM, the basic male 'underwear' model. If your unanimated (or underanimated) model is female, you can use PFBAM if it makes you feel good, but I don't think it'll make any difference. However, if your unanimated model includes a head, you need a model with animations and a head. For KotOR, I've used the Wookiee model, and for TSL I've used the Wookiee model and the Weequay model. I find the Weequay model superior because it doesn't have a hunched posture like the Wookiee, which you can see I used in my HK-47 Melee/Saber Mods. If the model you want to give animations has a cape, I'd use the Jedi robe model, which also has a robe/cape. You can use any model if you check them by this method first: import them into gmax/3dsmax. Choose the 'modify' tab and select the Aurorabase (named after the model). Look for 'super' (Screenie 1)
. If it says 'NULL', this model has it's own animations and can't be used for animating another model. Also, I'd recommend extracting the textures of your models into the same folder as them. It just helps to see what's what.
SMAT: Part 2: Setting the Bones
Now that you have chosen your models, extract them with KotOR Tool and compile them with MDLOps. Once you have your -ascii models, open two windows of NWMax. Yes, two (2). In one, import your unanimated model, the one you want to put animations on. In the other, import the ones with the animations you want. Just the geo only. Be sure to click 'set environ' in both windows (Also screenie 1)
. For now, select the skin (all textured parts, be sure to include the eyes, teeth, and tongue). In the already animated model, delete it. You won't need it, and it's easy to forget to delete it, which makes a mess. In the unanimated model, make a group out of it. Type an easy-to-remember name (how many of you will choose 'skin'?
) in the box in the upper toolbar and hit enter (See Screenie 2)
. Now you can select it all at once by clicking that name. Do that now, and hide it. You'll be left with just the bones and helpers. Now you need to get the bones of the animated model into the same position as that of the unanimated model. This prevents warping and stretching in the skin, as well as oddly placed and randomly floating parts. Usually this happens around the fingers. Anyway, I like to start with the torso, and work my way down the arms and legs. In the window containing the animated model, choose the move tool and select your first bone. Click the 'unlink' function (Screenie 3)
. Along the bottom, you can see the location of the object. Copy all three numbers from the unanimated model and paste them into that spot on the same bone on the animated model. The object should move to the same location as it is in the unanimated model. You'll notice that some other bones move with it. That's okay, as long as you remember to unlink the one you're moving. Otherwise it'll try to move and stay linked at the same time, and just rotate randomly. After you move a bone, you can hide it, just to get them out of the way. Do this until you've moved every single bone into place. Also remember to do this with the weapon placement helpers, the blue boxes usually named 'rhand' and 'lhand', or you'll have floating weapons. Usually I don't worry about rotation, but in the case of the weapon placement helpers I rotate them the same way they are in the original model, so the weapons point in the correct direction. Now you're set for the fun part, weighting the skin! (Don't get too excited, there)
SMAT: Part 3: Skinning
Remember the skin that we hid in the unanimated model at the beginning? Time to bring it back. Flip to the unanimated model, right click and hit 'unhide all'. If you haven't done it yet, save this. Now go to your animated model window. Select everything, and group it under a good name. Hide it all. Click file > merge. Select the other model you saved, and select all the skin geometry; head, torso, etc. Be sure to include the eyes, teeth, and tongue. When you open it, click 'yes to all' if a dialogue box pops up. This keeps everything pretty much where it should be. You'll notice that gmax didn't obey you; there's a lot of bones it imported too! Not to worry, that's supposed to happen. Those are the bones that the skin is currently attached to. Don't delete them! Normally weighting is a tedious, time consuming task, but I've found fairly simple way to shortcut this, so hold onto those bones. Select the skin again, and group it in this window the same way it was in your other one. Now hide it. Group the remaining bones that were imported to something that'll make you remember which ones they are, so you can get rid of them later. Something like 'trash bones' or so. Now unhide everything. Hide just these new bones, so you're left with the new skin and the original bones. Often times the eyes/teeth/tongue (what a troublesome lot!) are out of place, so you'll need to take a look at your unanimated model to get them in the correct place. Move these the same way you did the bones. Now we can start actually taking the skin off it's old bones and putting it on it's new body. Ugh, that sounds gruesome, doesn't it? Anyway, select a piece of skin, any piece; it may be distorted and mangled looking, but double-click on the 'editable mesh' modifier and it should snap into shape. No, we're not actually going to edit it, but we need it selected, with the blue vertices showing, or else what we're going to do won't work. Now, with the vertices still showing, select the 'skin' modifier. Now click 'edit envelopes'. It should overlay the model in blue, with different shades of red and yellow where the skin is attached to a certain bone. In the list on the right, select the top bone. Delete it. Only delete that bone. Now click 'add bone', and select the exact same one as you just deleted. Actually, if you remember, the one it was originally weighted to is hidden, so the one you selected is the same one of the original bones from the animated model. When you add the bone, you should see that the same colors as were there before you deleted the old ones reappeared. If you have the vertices showing, when you delete a bone then add a new one, the new one takes on all the weighting left in the area around it . . . which are the places now vacant from the deleted bone. So you saved all the time of weighting the skin one vertex at a time, or the randomness painting the weights, which usually turn out horribly inaccurate, and got the weighting from one set of bones to another. Do this to every bone on the list, then move on to each other piece of skin. Well, that doesn't include the eyes or teeth (But does include the tongue this time). They're rather special, so we'll get to them later. Just hide them if you want and get back to skinning. I'd recommend saving a lot, 'cause at least for me, gmax tends to crash sometimes when doing skins. Once you do all the bones in all the skins, unhide everything. Now select the new 'trash' bones and delete them. If you see sudden distortion among the skin, you missed some bones. Go back and try it again. You did save, right?
If nothing changed (except for the bones disappearing of course), then you did good. At least, as far as we know; often things happen differently in-game.
SMAT: Part 4: Re-Linking
Now we get to re-link everything. All the pieces in a model are linked to each other so they move together; for example, when an arm moves up, the hand follows it. When we rearranged the bones, you should've unlinked mostly everything so they can move without changing alignment. Now we need to fix that. Refer to you unanimated model window for what's linked to what (look to the right panel when an object is selected), and link the one in the animated model that way. Do this by selecting your bone, clicking 'link' (next to 'unlink', big surprise) and selecting the parent by name (hotkey 'h'). It'll be fairly easy to know if you missed a piece in-game, because that part will stand static in one place while the rest of the model twists and turns past it. When you've linked every bone the way they should be, select all of the skin except for the eyes and teeth. Now link the selected parts to your aurorabase (The blue box on the bottom named after you model). Otherwise, the skin will be invisible. Next, select all pieces of your eyes and your upper teeth and link them to the 'head_g', and link your lower teeth to 'f_jaw_g'. That's all for linking!
SMAT: Part 5: Finishing Up
Next is exporting and preparing our finished model. Select your aurorabase. It's currently named after the model you used to steal animations from, the pre-animated model. Rename it to be the model whose skin is on it, the previously unanimated model. Now click 'export geom only', to a different location than your original files. The exported file will be a .mdl. But it isn't really. Gmax deals in -ascii.mdl files. So rename this file to filename
-ascii.mdl. That's just adding "-ascii" before the extension. Now put it in the same location as your original .mdl and .mdx files of the originally animated model
, not the model you used the skin of. If there's already any -ascii models from when you compiled models at the beginning, delete them. Rename the original .mdl and .mdx to that of the originally unanimated model. Now open MDLOps. Select your new -ascii file and click 'read and write'. You should have 2 new files in the same directory labeled filename
-ascii-k2-bin.mdl and an .mdx of the same name. This example is for TSL, but if this is a model for the original KotOR, it'll have 'k1' in it's name instead of 'k2'. Move these two files to your override folder. Remove the 'ascii-k2-bin'. It should now be named the same thing as the original files you extracted. Congrats! Now you have your model, complete with animations! Drop it in the override, change your appearance with KSE if necessary, and fire it up! We'll soon know how closely you paid attention...
SMAT: That's All!
Here's some common problems and possible solutions that I encountered:
Nothing at all shows up in-game --
You probably forgot to link the skin to the aurorabase.
There are no animations on just the arm/leg/upper torso etc. --
If you didn't link one piece, it affects the whole section. For example, if you didn't link the bicep to the collar, the whole arm won't work.
Thanks for taking the time to read all this. I hope it helps out some people, though I know that there's only so many models that fit the criteria for this. If you have any questions or comments, ask in my thread. Thanks everyone for your support, and to the whole community for making modding such a great thing!