From 07392938d8b6762f597b134540309f4db41774da Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 22 Oct 2015 14:45:26 -1000 Subject: [PATCH] work on ANCS cooking --- DataSpec/DNACommon/ANCS.hpp | 2 ++ DataSpec/DNAMP1/ANCS.hpp | 7 +++++++ DataSpec/DNAMP1/ANIM.cpp | 4 ++-- DataSpec/DNAMP1/CMDL.hpp | 1 + DataSpec/DNAMP2/ANIM.cpp | 6 +++--- DataSpec/DNAMP3/ANIM.cpp | 6 +++--- DataSpec/SpecBase.hpp | 1 + DataSpec/SpecMP1.cpp | 3 +++ hecl | 2 +- 9 files changed, 23 insertions(+), 9 deletions(-) diff --git a/DataSpec/DNACommon/ANCS.hpp b/DataSpec/DNACommon/ANCS.hpp index 58dc31943..f17114df5 100644 --- a/DataSpec/DNACommon/ANCS.hpp +++ b/DataSpec/DNACommon/ANCS.hpp @@ -11,6 +11,8 @@ namespace Retro namespace DNAANCS { +using Actor = HECL::BlenderConnection::DataStream::Actor; + template struct CharacterResInfo { diff --git a/DataSpec/DNAMP1/ANCS.hpp b/DataSpec/DNAMP1/ANCS.hpp index 2680a5c5d..7fa3f9cc9 100644 --- a/DataSpec/DNAMP1/ANCS.hpp +++ b/DataSpec/DNAMP1/ANCS.hpp @@ -413,6 +413,13 @@ struct ANCS : BigYAML return true; } + + static bool Cook(const HECL::ProjectPath& outPath, + const HECL::ProjectPath& inPath, + const DNAANCS::Actor& actor) + { + return true; + } }; } diff --git a/DataSpec/DNAMP1/ANIM.cpp b/DataSpec/DNAMP1/ANIM.cpp index 63210566a..dbeacff58 100644 --- a/DataSpec/DNAMP1/ANIM.cpp +++ b/DataSpec/DNAMP1/ANIM.cpp @@ -49,7 +49,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co for (int c=0 ; c<4 ; ++c) { auto frameit = frames.begin(); - ao.changeCurve(ANIMOutStream::CurveRotate, c, rotKeys.size()); + ao.changeCurve(ANIMOutStream::CurveType::CurveRotate, c, rotKeys.size()); for (const DNAANIM::Value& val : rotKeys) ao.write(*frameit++, val.v4.vec[c]); } @@ -60,7 +60,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co for (int c=0 ; c<3 ; ++c) { auto frameit = frames.begin(); - ao.changeCurve(ANIMOutStream::CurveTranslate, c, transKeys.size()); + ao.changeCurve(ANIMOutStream::CurveType::CurveTranslate, c, transKeys.size()); for (const DNAANIM::Value& val : transKeys) ao.write(*frameit++, val.v3.vec[c]); } diff --git a/DataSpec/DNAMP1/CMDL.hpp b/DataSpec/DNAMP1/CMDL.hpp index a87e01a6b..b6ffa5bd6 100644 --- a/DataSpec/DNAMP1/CMDL.hpp +++ b/DataSpec/DNAMP1/CMDL.hpp @@ -91,6 +91,7 @@ struct CMDL } writer.writeUint32Big(*vertCountIt++); } + writer.writeUint32Big(skinMesh.pos.size()); writer.writeUint32Big(skinMesh.boneNames.size()); for (const std::string& boneName : skinMesh.boneNames) writer.writeString(boneName); diff --git a/DataSpec/DNAMP2/ANIM.cpp b/DataSpec/DNAMP2/ANIM.cpp index 4b40e4b32..27be11e8c 100644 --- a/DataSpec/DNAMP2/ANIM.cpp +++ b/DataSpec/DNAMP2/ANIM.cpp @@ -60,7 +60,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co for (int c=0 ; c<4 ; ++c) { auto frameit = frames.begin(); - ao.changeCurve(ANIMOutStream::CurveRotate, c, rotKeys.size()); + ao.changeCurve(ANIMOutStream::CurveType::CurveRotate, c, rotKeys.size()); for (const DNAANIM::Value& val : rotKeys) ao.write(*frameit++, val.v4.vec[c]); } @@ -72,7 +72,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co for (int c=0 ; c<3 ; ++c) { auto frameit = frames.begin(); - ao.changeCurve(ANIMOutStream::CurveTranslate, c, transKeys.size()); + ao.changeCurve(ANIMOutStream::CurveType::CurveTranslate, c, transKeys.size()); for (const DNAANIM::Value& val : transKeys) ao.write(*frameit++, val.v3.vec[c]); } @@ -84,7 +84,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co for (int c=0 ; c<3 ; ++c) { auto frameit = frames.begin(); - ao.changeCurve(ANIMOutStream::CurveScale, c, scaleKeys.size()); + ao.changeCurve(ANIMOutStream::CurveType::CurveScale, c, scaleKeys.size()); for (const DNAANIM::Value& val : scaleKeys) ao.write(*frameit++, val.v3.vec[c]); } diff --git a/DataSpec/DNAMP3/ANIM.cpp b/DataSpec/DNAMP3/ANIM.cpp index 38f182994..a5962942a 100644 --- a/DataSpec/DNAMP3/ANIM.cpp +++ b/DataSpec/DNAMP3/ANIM.cpp @@ -77,7 +77,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co for (int c=0 ; c<4 ; ++c) { auto frameit = frames.begin(); - ao.changeCurve(ANIMOutStream::CurveRotate, c, rotKeys.size()); + ao.changeCurve(ANIMOutStream::CurveType::CurveRotate, c, rotKeys.size()); for (const DNAANIM::Value& val : rotKeys) ao.write(*frameit++, val.v4.vec[c]); } @@ -89,7 +89,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co for (int c=0 ; c<3 ; ++c) { auto frameit = frames.begin(); - ao.changeCurve(ANIMOutStream::CurveTranslate, c, transKeys.size()); + ao.changeCurve(ANIMOutStream::CurveType::CurveTranslate, c, transKeys.size()); for (const DNAANIM::Value& val : transKeys) ao.write(*frameit++, val.v3.vec[c]); } @@ -101,7 +101,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co for (int c=0 ; c<3 ; ++c) { auto frameit = frames.begin(); - ao.changeCurve(ANIMOutStream::CurveScale, c, scaleKeys.size()); + ao.changeCurve(ANIMOutStream::CurveType::CurveScale, c, scaleKeys.size()); for (const DNAANIM::Value& val : scaleKeys) ao.write(*frameit++, val.v3.vec[c]); } diff --git a/DataSpec/SpecBase.hpp b/DataSpec/SpecBase.hpp index 2ef5b8816..8dd23d013 100644 --- a/DataSpec/SpecBase.hpp +++ b/DataSpec/SpecBase.hpp @@ -46,6 +46,7 @@ struct SpecBase : HECL::Database::IDataSpec /* Cook handlers */ using BlendStream = HECL::BlenderConnection::DataStream; using Mesh = BlendStream::Mesh; + using Actor = BlendStream::Actor; virtual void cookMesh(const HECL::ProjectPath& out, const HECL::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const=0; virtual void cookActor(const HECL::ProjectPath& out, const HECL::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const=0; diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index f97815167..7c4568cda 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -8,6 +8,7 @@ #include "DNAMP1/MLVL.hpp" #include "DNAMP1/STRG.hpp" #include "DNAMP1/CMDL.hpp" +#include "DNAMP1/ANCS.hpp" namespace Retro { @@ -294,6 +295,8 @@ struct SpecMP1 : SpecBase void cookActor(const HECL::ProjectPath& out, const HECL::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { + Actor actor = ds.compileActor(); + DNAMP1::ANCS::Cook(out, in, actor); } void cookArea(const HECL::ProjectPath& out, const HECL::ProjectPath& in, diff --git a/hecl b/hecl index 8d513577c..94fedaa30 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 8d513577cb199a8e567119fe45356b75ab3700ed +Subproject commit 94fedaa3065cb8a75b204eae13cc6f0213aa426a