2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 22:27:43 +00:00

Migration to new ANIM extract

This commit is contained in:
Jack Andersen
2016-04-06 17:40:25 -10:00
parent cd8b6b6ed4
commit 9ee8840b54
29 changed files with 691 additions and 427 deletions

View File

@@ -146,12 +146,36 @@ void ProjectResourceFactoryBase::BackgroundIndexRecursiveProc(const hecl::Projec
}
else if (pathTag.type == SBIG('ANCS'))
{
hecl::ProjectPath subPath(path, ".|layout");
SObjectTag pathTag = TagFromPath(subPath, m_backgroundBlender);
if (pathTag)
hecl::BlenderConnection& conn = m_backgroundBlender.getBlenderConnection();
if (!conn.openBlend(path) || conn.getBlendType() != hecl::BlenderConnection::BlendType::Actor)
continue;
hecl::BlenderConnection::DataStream ds = conn.beginData();
std::vector<std::string> armatureNames = ds.getArmatureNames();
std::vector<std::string> actionNames = ds.getActionNames();
for (const std::string& arm : armatureNames)
{
m_tagToPath[pathTag] = path;
WriteTag(cacheWriter, pathTag, path);
hecl::SystemStringView sysStr(arm);
hecl::ProjectPath subPath = path.ensureAuxInfo(sysStr.c_str());
SObjectTag pathTag = TagFromPath(subPath, m_backgroundBlender);
if (pathTag)
{
m_tagToPath[pathTag] = path;
WriteTag(cacheWriter, pathTag, path);
}
}
for (const std::string& act : actionNames)
{
hecl::SystemStringView sysStr(act);
hecl::ProjectPath subPath = path.ensureAuxInfo(sysStr.c_str());
SObjectTag pathTag = TagFromPath(subPath, m_backgroundBlender);
if (pathTag)
{
m_tagToPath[pathTag] = path;
WriteTag(cacheWriter, pathTag, path);
}
}
}
}