#include "CMDL.hpp" #include "hecl/Blender/Connection.hpp" namespace DataSpec::DNAMP3 { bool CMDL::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool, hecl::blender::Token& btok, std::function) { /* Check for RigPair */ const typename CharacterAssociations::RigPair* rp = pakRouter.lookupCMDLRigPair(entry.id); CINF cinf; CSKR cskr; std::pair loadRp(nullptr, nullptr); if (rp) { pakRouter.lookupAndReadDNA(rp->first, cskr); pakRouter.lookupAndReadDNA(rp->second, cinf); loadRp.first = &cskr; loadRp.second = &cinf; } /* Do extract */ hecl::blender::Connection& conn = btok.getBlenderConnection(); if (!conn.createBlend(outPath, hecl::blender::BlendType::Mesh)) return false; DNACMDL::ReadCMDLToBlender, MaterialSet, std::pair, DNACMDL::SurfaceHeader_3, 5>( conn, rs, pakRouter, entry, dataSpec, loadRp); return conn.saveBlend(); } } // namespace DataSpec::DNAMP3