ANCS cook fix after wildcard refactor

This commit is contained in:
Jack Andersen 2016-09-23 08:56:42 -10:00
parent c8d44d181b
commit b02b6a4d09
2 changed files with 27 additions and 8 deletions

View File

@ -147,10 +147,17 @@ bool SpecBase::canCook(const hecl::ProjectPath& path, hecl::BlenderToken& btok)
{ {
if (!checkPathPrefix(path)) if (!checkPathPrefix(path))
return false; return false;
if (hecl::IsPathBlend(path))
hecl::ProjectPath asBlend;
if (path.getPathType() == hecl::ProjectPath::Type::Glob)
asBlend = path.getWithExtension(_S(".blend"), true);
else
asBlend = path;
if (hecl::IsPathBlend(asBlend))
{ {
hecl::BlenderConnection& conn = btok.getBlenderConnection(); hecl::BlenderConnection& conn = btok.getBlenderConnection();
if (!conn.openBlend(path)) if (!conn.openBlend(asBlend))
return false; return false;
if (conn.getBlendType() != hecl::BlenderConnection::BlendType::None) if (conn.getBlendType() != hecl::BlenderConnection::BlendType::None)
return true; return true;
@ -182,14 +189,21 @@ const hecl::Database::DataSpecEntry* SpecBase::overrideDataSpec(const hecl::Proj
{ {
if (!checkPathPrefix(path)) if (!checkPathPrefix(path))
return nullptr; return nullptr;
if (hecl::IsPathBlend(path))
hecl::ProjectPath asBlend;
if (path.getPathType() == hecl::ProjectPath::Type::Glob)
asBlend = path.getWithExtension(_S(".blend"), true);
else
asBlend = path;
if (hecl::IsPathBlend(asBlend))
{ {
if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _S(".CSKR")) || if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _S(".CSKR")) ||
hecl::StringUtils::EndsWith(path.getAuxInfo(), _S(".ANIM"))) hecl::StringUtils::EndsWith(path.getAuxInfo(), _S(".ANIM")))
return oldEntry; return oldEntry;
hecl::BlenderConnection& conn = btok.getBlenderConnection(); hecl::BlenderConnection& conn = btok.getBlenderConnection();
if (!conn.openBlend(path)) if (!conn.openBlend(asBlend))
{ {
Log.report(logvisor::Error, _S("unable to cook '%s'"), Log.report(logvisor::Error, _S("unable to cook '%s'"),
path.getAbsolutePath().c_str()); path.getAbsolutePath().c_str());
@ -211,10 +225,17 @@ void SpecBase::doCook(const hecl::ProjectPath& path, const hecl::ProjectPath& co
bool fast, hecl::BlenderToken& btok, FCookProgress progress) bool fast, hecl::BlenderToken& btok, FCookProgress progress)
{ {
DataSpec::g_curSpec.reset(this); DataSpec::g_curSpec.reset(this);
if (hecl::IsPathBlend(path))
hecl::ProjectPath asBlend;
if (path.getPathType() == hecl::ProjectPath::Type::Glob)
asBlend = path.getWithExtension(_S(".blend"), true);
else
asBlend = path;
if (hecl::IsPathBlend(asBlend))
{ {
hecl::BlenderConnection& conn = btok.getBlenderConnection(); hecl::BlenderConnection& conn = btok.getBlenderConnection();
if (!conn.openBlend(path)) if (!conn.openBlend(asBlend))
return; return;
switch (conn.getBlendType()) switch (conn.getBlendType())
{ {

View File

@ -70,8 +70,6 @@ void ProjectResourceFactoryBase::ReadCatalog(const hecl::ProjectPath& catalogPat
athena::io::YAMLNode& node = *p.second; athena::io::YAMLNode& node = *p.second;
hecl::ProjectPath path(m_proj->getProjectWorkingPath(), node.m_scalarString); hecl::ProjectPath path(m_proj->getProjectWorkingPath(), node.m_scalarString);
if (node.m_scalarString == "MP1/SamGunFx/PowerBeam.wpsm.yaml")
printf("");
if (node.m_type == YAML_SCALAR_NODE) if (node.m_type == YAML_SCALAR_NODE)
{ {
path = hecl::ProjectPath(m_proj->getProjectWorkingPath(), node.m_scalarString); path = hecl::ProjectPath(m_proj->getProjectWorkingPath(), node.m_scalarString);