Sign in to follow this  
Zombiewells

updating chest

Recommended Posts

91448041_swkotor2023-11-2409-08-18.png.de5ad30fe2cd0792ed5be22d81ceea18.pngTrying to update the chest and I am also having issues with the doors on the spire. A lot of times the axis controller seems out of whack. Everything is set to liner, but the lid animates down instead of up? Also the center part of the spire doors flips out, but the rest seems fine?

  • Like 1

Share this post


Link to post
Share on other sites

I am following these steps:
- Get .mdx .mdl file from Kotor_Tools
-convert the .mdl to ascii through Mdledit_v1.0.3
-import ascii through Kotormax
-once I have the vanilla mesh in max, I simply make a new mesh, the one I want to replace the old mesh with, align the new mesh to the old mesh, (basically the lid is on top of the lid and the base is on top of the old base) and attach the old mesh to the new mesh so it inherits animations/pivot points all that good jazz.
-delete the old mesh, and leaving the new mesh in its place
-I then fill the animation keys with blank keys, (read that mdledit has issues with blank keys? It crashes when I dont fill the animation bar up so) I also tried MDLOPS and it seems to handle black keys fine?
-I export through kotormax, I have also tried exporting through odyseebase
-convert the ascii back to mdl and mdx. 
-copy both the mdl and mdx to the override folder
-load the game, the chest lid is in the correct location, then it all goes wrong when I open it, AKA the lid goes down, not up. image.png.772af6d71ac508d9c626b6147f527103.pngimage.png.0dedeaca60057f264f0be263974b1dc1.png

I also tried setting all these to linear, or flagging mdledit to convert controllersimage.png.ea147d0fd63df8aa053a02aa4be92b6f.png

 

 

Share this post


Link to post
Share on other sites

I'd say you need to do a Reset XForm on all your custom meshes before you realign their pivots to match the pivot of the appropriate vanilla meshes.

As to animations, you can simply export the model from KMax without anims and then copy and paste the anims from the vanilla ASCII into your ASCII before compiling.

Share this post


Link to post
Share on other sites

I tried what you suggested, also made new geo, new animations, tons of tests. Looks like the animation was completely inverted no matter what/up was down left was right etc. but clicking this little fella fixed it. I have no clue what it did, or what it does?image.png.84247ee864e46908a2a1cd9cd408dd46.png

Share this post


Link to post
Share on other sites

You'd have to ask someone with much better technical knowledge of the model format than I to answer the question. Perhaps @seedhartha can answer regarding the compress quats flag? I assume it alters how they are stored in the model in some manner? A memory saving feature?

Share this post


Link to post
Share on other sites

Rotations in MDL files are stored as quaternions. They can be uncompressed (4 floats), or compressed (1 integer). Both should work, but Max is converting rotations from axis-angle representation, which does produce some artifacts. There's less chance of that occuring when rotations area compressed, I guess.

Share this post


Link to post
Share on other sites
            uint32_t temp = *reinterpret_cast<const uint32_t *>(&data[rowDataIdx]);
            float x = 1.0f - static_cast<float>(temp & 0x7ff) / 1023.0f;
            float y = 1.0f - static_cast<float>((temp >> 11) & 0x7ff) / 1023.0f;
            float z = 1.0f - static_cast<float>(temp >> 22) / 511.0f;
            float dot = x * x + y * y + z * z;
            float w;
 
            if (dot >= 1.0f) {
                float len = glm::sqrt(dot);
                x /= len;
                y /= len;
                z /= len;
                w = 0.0f;
            } else {
                w = -glm::sqrt(1.0f - dot);
            }

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