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:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user