Kensei Jintaro

Editing animations and rigging

Recommended Posts

So I've been playing around with some of the tools available, and have so far managed to rip out a model using Kotor Tool and then using MDLEdit I saved it as an ascii file. I then imported it to Blender 2.79, with the intention to export it as an fbx and then work on it in Maya.

I haven't yet figured out how to do that from Blender, since unlike the 2.8 release the UI is absolute garbage, but from what I've seen so far there's no skeleton rig involved at all in the exported files. There's a ton of transforms, and I've ripped out both the male Supermodel and male2, which strangely have different sets of animations.

Has anyone managed to rip out a rigged model? And if not, assuming you re-rigged the model yourself, does the game accept rigged models or does it only run using vertex animation? Or is it the transforms that drive the characters ingame?

Share this post


Link to post
Share on other sites

If you want to do anything with KOTOR, Blender is not really a productive route. The primary vector is Max via the KOTORMax I/O script. That said, your problem is almost certainly the fact that you used KTool to do the conversion. The version of MDLOps bundled with that is super ancient and should never be used, by anybody. You want to extract the model archives and then do the conversion to ASCII with MDLEdit (latest beta release here). KOTORBlender should work ASCIIs generated from that.

As to the character models, they are skeletal meshes, but they use meshes as bones (which double as shadowcasters). You can actually convert the rig to regular bones when exporting via FBX (at least from Max when flagging them as bones), like so:

K1_Male_Rig_Dance_02_TH.gif

If you were planning on using Blender to Maya back to Blender you are probably going to experience a lot of grief, especially when it comes to character models and animation.

Regarding the animations themselves, most humanoid animations (including player characters) are split across the five human supermodels - s_female01/02/03/s_male01/02. These are all linked together in a dependency chain. The duplicates exist because s_female03, the lowest in the chain, has exclusively female anims, which override the male equivalents higher up.

  • Like 2
  • Light Side Points 1

Share this post


Link to post
Share on other sites

So if I want to replace the Flurry, Power and Crit melee attacks, if I do it in s_male02 it will be propagated to male01? I was under the impression that male1 is the supermodel and everything else inherited from it in terms of animation, didn't expect the dependencies to run both ways, usually it's a hierarchy.

Unfortunately I don't poses, or work with Max, since when I first used it I found the animation workflow pretty rigid. I'm currently ditching Maya for Blender 2.8, so I figured this is a good opportunity to compare the 2 tool sets. Do you by any chance have a rigged supermodel fbx? I'll get the trial Max version and try to take out the model into an fbx anyway, but from what I've seen so far, each animation is regarded as it's own scene, rather than just a keyframe clip.

If I edit an animation, do I have to export it as it's own "object" then?

Edit: Also, I have used MDLEdit, I needed Kotor Tool to extract the .bif files, I haven't found any other way to get these files unpacked. I've tried Noesis and Xoreos tools but I haven't managed to get them to recognize anything.

Edited by Kensei Jintaro

Share this post


Link to post
Share on other sites

The game reads the player supermodels in a chain like this Body -> S_Female03 -> S_Female02 -> S_Female01 -> S_Male02 -> S_Male01. Any time it needs an animation it checks the base model, if what it needs isn't there then it checks the supermodel, it then checks that model's supermodel, etc. It stops as soon as it hits the anim it is looking for, so any anim lower in the chain will override an anim with the same name higher in the chain. Female body models set S_Female03 as their supermodel, and male body models set S_Female02. Thus, all unique female anims are on S_Female03 which male bodies never see. All the other anims are shared but are scaled via an animation scale factor specified in each model. This is especially important in K1 since not only are there height differences between the sexes, but each sex also has three different heights as well. But that side of things is handled dynamically by the engine, outside of any anims specifically on a given model (i.e. S_FemaleXX supermodels use a female rig, S_MaleXX supermodels use a male rig).

I don't use Blender, but as I understand it it needs to break each animation into a separate file or scene, or something like that. Which would make working on supermodels fairly impractical to say the least, given the number of anims on them. But someone familiar with Blender and KOTORBlender in particular would need to chime in there. I would think the only way to get a workable KOTOR model out of it would be to export the specific modified animation you wanted and then directly edit an ASCII copy of the relevant vanilla supermodel in a text editor, replacing the original anim block with your modified one, then compile.

If you are still having troubles even getting models into Blender then again I can't help specifically with that other than to suggest that you make sure you have the latest version of KOTORBlender.

Edit: Regarding the specific attacks you mentioned, there are actually a number of anims for each. For example, in K1 Flurry has a perform anim, a damage anim, and a parry anim. Each weapon type - single, dual wield, double - has its own set of anims. Then in TSL this is tripled, each attack having three anim variants for each of perform/damage/parry, and it adds in the same for unarmed for good measure. TSL handily provides descriptions for most of its anims in animation.2da (for example, the Flurry Damage 1 anim for single swords/sabers is f2d2a). K1 doesn't provide any such description, so you'll have to do some detective work to figure it out.

  • Thanks 2

Share this post


Link to post
Share on other sites

Bit of an addition to DarthParametric's elaboration earlier -

Quote

Regarding the specific attacks you mentioned, there are actually a number of anims for each. For example, in K1 Flurry has a perform anim, a damage anim, and a parry anim. Each weapon type - single, dual wield, double - has its own set of anims. ...TSL handily provides descriptions for most of its anims in animation.2da (for example, the Flurry Damage 1 anim for single swords/sabers is f2d2a). K1 doesn't provide any such description...

Thankfully, @JCarter426 did write an extensive Analysis of the Combat Animations' tutorial to cover such lacks of description for K1 which should provide necessary information ones could need on this particular attempt.

Edited by ebmar
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Aight I've finally gotten my hands on the model, but I need a bit of info about how the override works in K2, mainly for iterating.

At import, the character comes in with 16600 keyframes, with the entire set of animations on one track. I'm gonna assume that K2 can't recognize different tracks and simply has hardcoded frame pointers for each animation to fire off.

So, here's the question, am I limited to frames available in the original animation, or can I exceed that limit and somehow overwrite the original frame pointers, maybe in a .2da (it's my understanding is that it's just a 2d array)?

Also, when exporting, I suspect I have to export the entire model with all of it's animations, can't simply export the model + the ones I want. Correct me if I'm wrong.

Once exported, do I place the .mdl in the override folder or do I have to patch it into the .bif for it to be recognized by the engine?

Is there a "training dummy" object I can spawn in K2 in order to test the anims?

Share this post


Link to post
Share on other sites
5 minutes ago, Kensei Jintaro said:

Aight I've finally gotten my hands on the model, but I need a bit of info about how the override works in K2, mainly for iterating.

At import, the character comes in with 16600 keyframes, with the entire set of animations on one track. I'm gonna assume that K2 can't recognize different tracks and simply has hardcoded frame pointers for each animation to fire off.

So, here's the question, am I limited to frames available in the original animation, or can I exceed that limit and somehow overwrite the original frame pointers, maybe in a .2da (it's my understanding is that it's just a 2d array)?

Also, when exporting, I suspect I have to export the entire model with all of it's animations, can't simply export the model + the ones I want. Correct me if I'm wrong.

Once exported, do I place the .mdl in the override folder or do I have to patch it into the .bif for it to be recognized by the engine?

Is there a "training dummy" object I can spawn in K2 in order to test the anims?

I'm guessing your talking about the state of affairs after importing with KOTORmax?

Anyway, the animations aren't hardcoded, you can add additional keyframes that exceed the 16600 as you say. It's max that has the limitation of just one timeline, KOTORmax therefore loads the animations onto it in sequence. It has an animation editor through which you can keep track of which keyframes belong to which animations. You can simply add a new animation and assign the keyframes you want to it.

Although, using the new animations in the game is a different story. I think in K2 it should suffice to list it in animations.2da and then it's possible to call it via script. But I'm not sure it's as simple in K1.

You may delete the animations in the animation editor if you want. This means they won't be exported from KOTORmax.

Once the model is exported, first you need to compile it back to binary. After that you either place it in the override folder or you put it in a .mod file (which represents a module). Modders generally never edit .bif, .rim and .erf files, we leave those as a source of the original files. For just a character model, you'll be fine putting it in the override folder. Also note that K2 will recognize files in the subfolders of the override folder, while K1 won't.

Not sure what you mean with the training dummy.

  • Thanks 1
  • Light Side Points 1

Share this post


Link to post
Share on other sites

I wanna do this for K2, not interested in K1 really.

For training dummy I mean something I can spam attacks to check if the animations fire off properly, instead of spawning enemies and managing combat. Basically an enemy that doesn't attack and has 1000000000000000 hp or something.

As for the animations, yeah I've checked out the extra things and have found the animation range I'm looking for, although exporting a readable fbx with bones and the animation range so far hasn't yielded a result for me. At least following Parametric's advice and asking Max to convert dummies to bones hasn't resulted in a bone hierarchy for me. Hopefully I'll find a way to export an fbx with a rigged model, with the animations to boot. So far I've had no luck tho, only empty transforms.

Share this post


Link to post
Share on other sites

Trying to do the same thing as Kensei, I noticed the lack of punching animations in KOTOR 2's unarmed style so I'm looking to fix that and replace all those Olympic athlete kicks with some jabs and uppercuts.

Looking forward to seeing your progress as animation modding resources seem incredibly scarce.

Share this post


Link to post
Share on other sites

I have to put this on hold until the end of March unfortunately, but I think I have it figured out, although exporting the dummy transforms as bones failed, i think I can set up a control rig with some IK's to drive the things regardless.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.