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

Much more reliable CMDL with CINF/CSKR extract

This commit is contained in:
Jack Andersen
2015-09-05 19:34:30 -10:00
parent 4ede471d1e
commit cf7836fc9a
14 changed files with 151 additions and 82 deletions

View File

@@ -23,11 +23,25 @@ struct CMDL
bool force,
std::function<void(const HECL::SystemChar*)> fileChanged)
{
/* Check for RigPair */
const PAKRouter<PAKBridge>::RigPair* rp = pakRouter.lookupCMDLRigPair(entry.id);
CINF cinf;
CSKR cskr;
std::pair<CSKR*,CINF*> loadRp(nullptr, nullptr);
if (rp)
{
pakRouter.lookupAndReadDNA(rp->first, cskr);
pakRouter.lookupAndReadDNA(rp->second, cinf);
loadRp.first = &cskr;
loadRp.second = &cinf;
}
/* Do extract */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(outPath.getAbsolutePath()))
return false;
DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, 2>
(conn, rs, pakRouter, entry, dataSpec);
(conn, rs, pakRouter, entry, dataSpec, loadRp);
return conn.saveBlend();
}
};