#ifndef _DNAMP3_CMDL_HPP_ #define _DNAMP3_CMDL_HPP_ #include "../DNACommon/DNACommon.hpp" #include "../DNACommon/CMDL.hpp" #include "CMDLMaterials.hpp" #include "DNAMP3.hpp" #include "CINF.hpp" #include "CSKR.hpp" namespace Retro { namespace DNAMP3 { struct CMDL { static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const HECL::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, std::function fileChanged) { /* Check for RigPair */ const PAKRouter::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::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); if (!conn.createBlend(outPath.getAbsolutePath())) return false; DNACMDL::ReadCMDLToBlender, MaterialSet, std::pair, DNACMDL::SurfaceHeader_3, 5> (conn, rs, pakRouter, entry, dataSpec, loadRp); return conn.saveBlend(); } }; } } #endif // _DNAMP3_CMDL_HPP_