Sign in to follow this  
yoshiharu

unpack requires a buffer of 4 bytes

Recommended Posts

Hello. I'm trying to export a handful of animations from KotOR I and II into Blender, and have had mixed results. I understand most of the player animations are to be found in the supermodel (s_male01), but once I've converted the model from ascii to binary through MDLOps, BlenderBlender 3.6.0 tells me "unpack requires a buffer of 4 bytes" when I try to import the MDL. Not all models do this, but both supermodels do, unfortunately.

What is there to be done? Thank you.

Edited by yoshiharu

Share this post


Link to post
Share on other sites
4 hours ago, yoshiharu said:

once I've converted the model from ascii to binary through MDLOps

Why are you converting the models at all? KBlender loads binary models directly. The use of MDLEdit/MDLOps is only required when using KMax.

Share this post


Link to post
Share on other sites

  

12 hours ago, DarthParametric said:

Why are you converting the models at all? KBlender loads binary models directly. The use of MDLEdit/MDLOps is only required when using KMax.

Because KotOR Tool exports ASCII models unless you press the "Extract file" button, and KBlender didn't play nice with those. I figured it out. Thanks. ☺️

S'more questions for you kind folk.

  • What is base framerate of KotOR animations?
  • Are they listed/named somewhere? I notice DLGEditor references things like "1006_DEAD" or "1011_DROP_TO_KNEES", but those numbers don't correspond to anything intuitive.
  • Despite toggling "Build Armature", KBlender does no such thing. Is it possible to get bones, or must I add them myself?

Thank you.

Edited by yoshiharu

Share this post


Link to post
Share on other sites

You should never convert models to ASCII with KTool full-stop. It uses the ancient, broken version of MDLOps. Just extract all the MDL/MDXs in one go rather than trying to do them individually. There's a button for "extract entire BIF sub-type" that will dump the selected category.

As to your other questions:

  • All KOTOR anims are 30fps.
  • You can see some "human-friendly" names in TSL's animations.2da, but K1 lacks a similar column. But you can decipher the combat animations using this guide by JC.
  • Odyssey doesn't use bones in the modern sense. It uses the oldschool approach of meshes as bones. Any animated mesh includes the bones in the model.

Share this post


Link to post
Share on other sites
34 minutes ago, DarthParametric said:
  • You can see some "human-friendly" names in TSL's animations.2da, but K1 lacks a similar column.

Thanks; I didn't know about that. How would I go about identifying the corresponding animations though? I see no mention of framerate numbers, nor the supermodel to which they belong.


Speaking of which, I have played through all the anims in s_male 01-02, as well s_female 01-03 for both games @ 24 FPS in Blender, and I can't find what I'm looking for. Are there other player animations, like in cutscenes, or did I miss something? Thanks again.

Edited by yoshiharu

Share this post


Link to post
Share on other sites
On 4/17/2023 at 2:11 PM, DarthParametric said:

Certain cutscenes use custom stunt animations, yes. For example, the Light Side ending ceremony.

Where might I find those? Thanks.

Share this post


Link to post
Share on other sites

They are models named according to the scheme of the module they are associated with. The DLG for a specific scene will list any character and animated camera stunt models in its top node. For example, the aforementioned LS ending cutscene (m41ad_c01.dlg) :

m41ad_c01.png.c969ba40b30130758eff63914868c981.png

There's no master list anywhere that I am aware of, so you'll need to go searching for them yourself. Although if you have extracted all the models from the BIF then you should be able to find them just be searching for "*_c0". I can see 103 character stunt models and 23 camera models for K1, for example:

K1_Stunt_Models.png.9ba825933c662b2eb3e9a67c1ca0b949.png

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.

Sign in to follow this