Zombiewells 7 Posted November 24, 2023 Trying 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? 1 Quote Share this post Link to post Share on other sites
DarthParametric 3,766 Posted November 24, 2023 Are you creating new anims, or trying to use the vanilla ones? Exporting from KBlender? Quote Share this post Link to post Share on other sites
Zombiewells 7 Posted November 24, 2023 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. I also tried setting all these to linear, or flagging mdledit to convert controllers Quote Share this post Link to post Share on other sites
DarthParametric 3,766 Posted November 24, 2023 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. Quote Share this post Link to post Share on other sites
Zombiewells 7 Posted November 25, 2023 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? Quote Share this post Link to post Share on other sites
DarthParametric 3,766 Posted November 25, 2023 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? Quote Share this post Link to post Share on other sites
seedhartha 116 Posted November 25, 2023 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. Quote Share this post Link to post Share on other sites
Zombiewells 7 Posted November 25, 2023 Sweet! Good to know I'll look out for that error and head towards this solve but try compressed first. Thank you both!! Quote Share this post Link to post Share on other sites
DarthParametric 3,766 Posted November 26, 2023 12 hours ago, seedhartha said: compressed (1 integer) How does that work? Uses a lookup table of values or something? Quote Share this post Link to post Share on other sites
seedhartha 116 Posted November 26, 2023 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); } Quote Share this post Link to post Share on other sites