mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 13:44:56 +00:00
Initially working CEnvFxManager
This commit is contained in:
@@ -33,6 +33,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn,
|
||||
hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
|
||||
if (force || cmdlPath.isNone())
|
||||
{
|
||||
cmdlPath.makeDirChain(false);
|
||||
if (!conn.createBlend(cmdlPath, hecl::blender::BlendType::Mesh))
|
||||
return false;
|
||||
|
||||
@@ -70,6 +71,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn,
|
||||
hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
|
||||
if (force || cmdlPath.isNone())
|
||||
{
|
||||
cmdlPath.makeDirChain(false);
|
||||
if (!conn.createBlend(cmdlPath, hecl::blender::BlendType::Mesh))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -652,6 +652,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os,
|
||||
{
|
||||
MaterialSet matSet;
|
||||
matSet.read(reader);
|
||||
matSet.ensureTexturesExtracted(pakRouter);
|
||||
GetVertexAttributes(matSet, vertAttribs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,25 @@ struct MaterialSet : BigDNA
|
||||
|
||||
void addTexture(const UniqueID32& id) {textureIDs.push_back(id); ++textureCount;}
|
||||
void addMaterialEndOff(atUint32 off) {materialEndOffs.push_back(off); ++materialCount;}
|
||||
|
||||
template <class PAKBRIDGE>
|
||||
void ensureTexturesExtracted(PAKRouter<PAKBRIDGE>& pakRouter) const
|
||||
{
|
||||
for (const auto& id : textureIDs)
|
||||
{
|
||||
const nod::Node* node;
|
||||
const PAK::Entry* texEntry = pakRouter.lookupEntry(id, &node);
|
||||
if (!texEntry)
|
||||
continue;
|
||||
hecl::ProjectPath txtrPath = pakRouter.getWorking(texEntry);
|
||||
if (txtrPath.isNone())
|
||||
{
|
||||
txtrPath.makeDirChain(false);
|
||||
PAKEntryReadStream rs = texEntry->beginReadStream(*node);
|
||||
TXTR::Extract(rs, txtrPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
} head;
|
||||
|
||||
struct Material : BigDNA
|
||||
@@ -352,6 +371,10 @@ struct MaterialSet : BigDNA
|
||||
}
|
||||
}
|
||||
|
||||
void ensureTexturesExtracted(PAKRouter<PAKBridge>& pakRouter) const
|
||||
{
|
||||
head.ensureTexturesExtracted(pakRouter);
|
||||
}
|
||||
};
|
||||
|
||||
struct HMDLMaterialSet : BigDNA
|
||||
|
||||
@@ -71,6 +71,11 @@ struct MaterialSet : BigDNA
|
||||
{
|
||||
DNACMDL::ReadMaterialSetToBlender_1_2(os, *this, pakRouter, entry, setIdx);
|
||||
}
|
||||
|
||||
void ensureTexturesExtracted(PAKRouter<PAKBridge>& pakRouter) const
|
||||
{
|
||||
head.ensureTexturesExtracted(pakRouter);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -198,6 +198,8 @@ struct MaterialSet : BigDNA
|
||||
{
|
||||
DNACMDL::ReadMaterialSetToBlender_3(os, *this, pakRouter, entry, setIdx);
|
||||
}
|
||||
|
||||
void ensureTexturesExtracted(PAKRouter<PAKBridge>& pakRouter) const {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user