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

CINF/CSKR integration

This commit is contained in:
Jack Andersen
2015-08-12 21:29:00 -10:00
parent cdd7b45394
commit fd550702e1
21 changed files with 604 additions and 36 deletions

View File

@@ -293,12 +293,13 @@ public:
}
};
template <class PAKRouter, class MaterialSet, atUint32 Version>
template <class PAKRouter, class MaterialSet, class RIGPAIR, atUint32 Version>
bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
Athena::io::IStreamReader& reader,
PAKRouter& pakRouter,
const typename PAKRouter::EntryType& entry,
const HECL::ProjectPath& masterShader)
const HECL::ProjectPath& masterShader,
const RIGPAIR* rp=nullptr)
{
reader.setEndian(Athena::BigEndian);
@@ -401,6 +402,9 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
"bm = bmesh.new()\n"
"\n", pakRouter.getBestEntryName(entry).c_str());
if (rp)
os << "dvert_lay = bm.verts.layers.deform.verify()\n";
/* Link master shader library */
os.format("# Master shader library\n"
"with bpy.data.libraries.load('%s', link=True, relative=True) as (data_from, data_to):\n"
@@ -520,8 +524,10 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
for (size_t i=0 ; i<=maxIdxs.pos ; ++i)
{
atVec3f pos = reader.readVec3f();
os.format("bm.verts.new((%f,%f,%f))\n",
os.format("vert = bm.verts.new((%f,%f,%f))\n",
pos.vec[0], pos.vec[1], pos.vec[2]);
if (rp)
rp->first->weightVertex(os, *rp->second, i);
}
break;
}
@@ -817,6 +823,9 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
"bm.free()\n"
"\n", head.matSetCount);
if (rp)
rp->second->sendVertexGroupsToBlender(os);
return true;
}