2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 07:47:42 +00:00

CMDL cooking updates

This commit is contained in:
Jack Andersen
2015-10-06 15:17:17 -10:00
parent cdeb1234c8
commit 3b7f7f2f3a
16 changed files with 63 additions and 30 deletions

View File

@@ -93,7 +93,7 @@ bool SpecBase::canCook(const HECL::ProjectPath& path)
if (HECL::IsPathBlend(path))
{
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.openBlend(path.getAbsolutePath()))
if (!conn.openBlend(path))
return false;
if (conn.getBlendType() != HECL::BlenderConnection::TypeNone)
return true;
@@ -112,21 +112,40 @@ bool SpecBase::canCook(const HECL::ProjectPath& path)
return false;
}
using Mesh = HECL::BlenderConnection::DataStream::Mesh;
void SpecBase::doCook(const HECL::ProjectPath& path, const HECL::ProjectPath& cookedPath)
{
if (HECL::IsPathBlend(path))
{
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.openBlend(path.getAbsolutePath()))
if (!conn.openBlend(path))
return;
if (conn.getBlendType() == HECL::BlenderConnection::TypeMesh)
switch (conn.getBlendType())
{
case HECL::BlenderConnection::TypeMesh:
{
HECL::BlenderConnection::DataStream ds = conn.beginData();
Mesh mesh = ds.compileMesh();
ds.close();
cookMesh(path, ds, cookedPath);
break;
}
case HECL::BlenderConnection::TypeActor:
{
HECL::BlenderConnection::DataStream ds = conn.beginData();
cookActor(path, ds, cookedPath);
break;
}
case HECL::BlenderConnection::TypeArea:
{
HECL::BlenderConnection::DataStream ds = conn.beginData();
cookArea(path, ds, cookedPath);
break;
}
default: break;
}
}
else if (HECL::IsPathYAML(path))
{
FILE* fp = HECL::Fopen(path.getAbsolutePath().c_str(), _S("r"));
cookYAML(fp, cookedPath);
}
}