Extract directory selection fix

This commit is contained in:
Jack Andersen 2015-10-15 14:35:40 -10:00
parent 0e23ca481b
commit d0404680fd
5 changed files with 23 additions and 5 deletions

View File

@ -45,7 +45,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn,
for (const auto& info : chResInfo)
{
const NOD::Node* node;
const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(info.cmdl, &node, true);
const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(info.cmdl, &node, true, true);
if (cmdlE)
{
HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
@ -119,7 +119,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn,
os << "actor_subtype.linked_armature = arm_obj.name\n";
/* Link CMDL */
const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(info.cmdl, nullptr, true);
const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(info.cmdl, nullptr, true, true);
if (cmdlE)
{
HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
@ -140,7 +140,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn,
os.format("overlay.name = '%s'\n", overlay.first.toString().c_str());
/* Link CMDL */
const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(overlay.second.first, nullptr, true);
const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(overlay.second.first, nullptr, true, true);
if (cmdlE)
{
HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);

View File

@ -1042,6 +1042,7 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath
/* Build material sets */
{
HECL::Frontend::Frontend FE;
FE.getDiagnostics().setBackend("GX");
for (const std::vector<Mesh::Material>& mset : mesh.materialSets)
{
for (const Mesh::Material& mat : mset)

View File

@ -355,6 +355,7 @@ public:
return HECL::ProjectPath(pakPath, entName);
}
}
auto uniqueSearch = m_uniqueEntries.find(entry->id);
if (uniqueSearch != m_uniqueEntries.end())
{
@ -370,6 +371,7 @@ public:
entName += extractor.fileExts[0];
return HECL::ProjectPath(uniquePath, entName);
}
auto sharedSearch = m_sharedEntries.find(entry->id);
if (sharedSearch != m_sharedEntries.end())
{
@ -405,6 +407,7 @@ public:
m_sharedWorking.makeDir();
return sharedPath;
}
LogDNACommon.report(LogVisor::FatalError, "Unable to find entry %s", entry->id.toString().c_str());
return HECL::ProjectPath();
}
@ -553,11 +556,13 @@ public:
const typename BRIDGETYPE::PAKType::Entry* lookupEntry(const IDType& entry,
const NOD::Node** nodeOut=nullptr,
bool silenceWarnings=false) const
bool silenceWarnings=false,
bool currentPAK=false) const
{
if (!m_bridges)
LogDNACommon.report(LogVisor::FatalError,
"PAKRouter::build() must be called before PAKRouter::lookupEntry()");
if (m_pak)
{
const EntryType* ent = m_pak->lookupEntry(entry);
@ -568,6 +573,14 @@ public:
return ent;
}
}
if (currentPAK)
{
if (!silenceWarnings)
LogDNACommon.report(LogVisor::Warning, "unable to find PAK entry %s in current PAK", entry.toString().c_str());
return nullptr;
}
for (const BRIDGETYPE& bridge : *m_bridges)
{
const PAKType& pak = bridge.getPAK();
@ -579,6 +592,7 @@ public:
return ent;
}
}
if (!silenceWarnings)
LogDNACommon.report(LogVisor::Warning, "unable to find PAK entry %s", entry.toString().c_str());
if (nodeOut)

View File

@ -345,6 +345,9 @@ struct MaterialSet : BigDNA
{
DNACMDL::ReadMaterialSetToBlender_1_2(os, *this, pakRouter, entry, setIdx);
}
MaterialSet() = default;
MaterialSet(const HECL::Backend::GX& gx);
};
}

2
hecl

@ -1 +1 @@
Subproject commit 1c6a7be8302dfd1bafd6ba8fc1d82c88bcf6048c
Subproject commit 808006875cd237ebd7c9a6ae6b6b0b9391f3da9f