2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 04:27:42 +00:00

ANIM cooking bug fixes

This commit is contained in:
Jack Andersen
2016-08-28 14:28:53 -10:00
parent 969e2a86de
commit bf992f2d16
3 changed files with 45 additions and 54 deletions

View File

@@ -514,6 +514,8 @@ ANIM::ANIM(const BlenderAction& act,
newAnim.bones.reserve(act.channels.size());
size_t extChanCount = 0;
std::unordered_set<atInt32> addedBones;
addedBones.reserve(act.channels.size());
for (const BlenderAction::Channel& chan : act.channels)
{
auto search = idMap.find(chan.boneName);
@@ -522,6 +524,9 @@ ANIM::ANIM(const BlenderAction& act,
Log.report(logvisor::Warning, "unable to find id for bone '%s'", chan.boneName.c_str());
continue;
}
if (addedBones.find(search->second) != addedBones.cend())
continue;
addedBones.insert(search->second);
extChanCount += std::max(zeus::PopCount(chan.attrMask), 2);
newAnim.bones.emplace_back(search->second, (chan.attrMask & 0x2) != 0);