diff --git a/DataSpec/DNAMP2/ANIM.cpp b/DataSpec/DNAMP2/ANIM.cpp index d617938ff..09b10c57c 100644 --- a/DataSpec/DNAMP2/ANIM.cpp +++ b/DataSpec/DNAMP2/ANIM.cpp @@ -128,7 +128,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) { atUint8 idx = reader.readUByte(); if (idx != 0xff) - std::get<1>(bones.back().second) = true; + std::get<1>(bones[b].second) = true; } boneCount = reader.readUint32Big(); @@ -136,7 +136,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) { atUint8 idx = reader.readUByte(); if (idx != 0xff) - std::get<2>(bones.back().second) = true; + std::get<2>(bones[b].second) = true; } channels.clear(); diff --git a/DataSpec/DNAMP3/ANIM.cpp b/DataSpec/DNAMP3/ANIM.cpp index 03c417c2c..a621349d7 100644 --- a/DataSpec/DNAMP3/ANIM.cpp +++ b/DataSpec/DNAMP3/ANIM.cpp @@ -14,7 +14,6 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co os.format("act.hecl_fps = round(%f)\n", (1.0f / mainInterval)); auto kit = chanKeys.begin() + 1; - int idx = 1; for (const std::pair>& bone : bones) { const std::string* bName = cinf.getBoneNameFromId(bone.first); @@ -68,7 +67,6 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co if (std::get<0>(bone.second)) { const std::vector& rotKeys = *kit++; - ++idx; for (int c=0 ; c<4 ; ++c) { auto frameit = frames.begin(); @@ -81,7 +79,6 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co if (std::get<1>(bone.second)) { const std::vector& transKeys = *kit++; - ++idx; for (int c=0 ; c<3 ; ++c) { auto frameit = frames.begin(); @@ -94,7 +91,6 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co if (std::get<2>(bone.second)) { const std::vector& scaleKeys = *kit++; - ++idx; for (int c=0 ; c<3 ; ++c) { auto frameit = frames.begin(); @@ -142,7 +138,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) { atUint8 idx = reader.readUByte(); if (idx != 0xff) - std::get<1>(bones.back().second) = true; + std::get<1>(bones[b].second) = true; } boneCount = reader.readUint32Big(); @@ -150,11 +146,14 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) { atUint8 idx = reader.readUByte(); if (idx != 0xff) - std::get<2>(bones.back().second) = true; + std::get<2>(bones[b].second) = true; } channels.clear(); chanKeys.clear(); + channels.emplace_back(); + channels.back().type = DNAANIM::Channel::KF_HEAD; + chanKeys.emplace_back(); for (const std::pair>& bone : bones) { if (std::get<0>(bone.second)) @@ -181,7 +180,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) } reader.readUint32Big(); - auto kit = chanKeys.begin(); + auto kit = chanKeys.begin() + 1; for (const std::pair>& bone : bones) { if (std::get<0>(bone.second)) @@ -197,7 +196,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) } reader.readUint32Big(); - kit = chanKeys.begin(); + kit = chanKeys.begin() + 1; for (const std::pair>& bone : bones) { if (std::get<0>(bone.second)) @@ -213,7 +212,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) } reader.readUint32Big(); - kit = chanKeys.begin(); + kit = chanKeys.begin() + 1; for (const std::pair>& bone : bones) { if (std::get<0>(bone.second)) diff --git a/DataSpec/DNAMP3/ANIM.hpp b/DataSpec/DNAMP3/ANIM.hpp index 6c21194e8..74067f96e 100644 --- a/DataSpec/DNAMP3/ANIM.hpp +++ b/DataSpec/DNAMP3/ANIM.hpp @@ -38,6 +38,7 @@ struct ANIM : BigDNA struct Header : BigDNA { DECL_DNA + Value unkS; Value duration; Value unk0; Value interval;