2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 13:47:43 +00:00

ANIM cook variable scope fix

This commit is contained in:
Jack Andersen
2017-12-22 19:40:50 -10:00
parent 053ebd41c4
commit 2a341847d4
4 changed files with 10 additions and 5 deletions

View File

@@ -1364,14 +1364,19 @@ bool ANCS::CookANIM(const hecl::ProjectPath& outPath,
/* Build bone ID map */
std::unordered_map<std::string, atInt32> boneIdMap;
std::experimental::optional<CINF> rigCinf;
std::experimental::optional<DNAANIM::RigInverter<CINF>> rigInv;
for (const DNAANCS::Actor::Armature& arm : actor.armatures)
{
CINF cinf(arm, boneIdMap);
if (!rigInv)
{
rigCinf.emplace(arm, boneIdMap);
auto matrices = ds.getBoneMatrices(arm.name);
rigInv.emplace(cinf, matrices);
rigInv.emplace(*rigCinf, matrices);
}
else
{
CINF cinf(arm, boneIdMap);
}
}