From c9a38c567f60daeeddb7c65835cabd151f1e43ba Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 29 Jan 2019 11:36:43 -1000 Subject: [PATCH] Fix for extracting animations which animate undefined bones --- DataSpec/DNAMP1/ANIM.cpp | 6 +++++- DataSpec/DNAMP2/ANIM.cpp | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/DataSpec/DNAMP1/ANIM.cpp b/DataSpec/DNAMP1/ANIM.cpp index 28a66f509..ab75260fc 100644 --- a/DataSpec/DNAMP1/ANIM.cpp +++ b/DataSpec/DNAMP1/ANIM.cpp @@ -19,8 +19,12 @@ void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANI for (const std::pair& bone : bones) { const std::string* bName = rig.getCINF().getBoneNameFromId(bone.first); - if (!bName) + if (!bName) { + ++kit; + if (bone.second) + ++kit; continue; + } os.format("bone_string = '%s'\n", bName->c_str()); os << "action_group = act.groups.new(bone_string)\n" diff --git a/DataSpec/DNAMP2/ANIM.cpp b/DataSpec/DNAMP2/ANIM.cpp index 71373c021..8b74bb668 100644 --- a/DataSpec/DNAMP2/ANIM.cpp +++ b/DataSpec/DNAMP2/ANIM.cpp @@ -18,8 +18,15 @@ void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANI for (const std::pair>& bone : bones) { const std::string* bName = rig.getCINF().getBoneNameFromId(bone.first); - if (!bName) + if (!bName) { + if (std::get<0>(bone.second)) + ++kit; + if (std::get<1>(bone.second)) + ++kit; + if (std::get<2>(bone.second)) + ++kit; continue; + } os.format("bone_string = '%s'\n", bName->c_str()); os << "action_group = act.groups.new(bone_string)\n"