#ifndef _DNAMP3_ANIM_HPP_ #define _DNAMP3_ANIM_HPP_ #include "BlenderConnection.hpp" #include "DNAMP3.hpp" #include "../DNACommon/ANIM.hpp" #include "CINF.hpp" namespace DataSpec { namespace DNAMP3 { struct ANIM : BigDNA { Delete expl; struct IANIM : BigDNA { Delete expl; atUint32 m_version; IANIM(atUint32 version) : m_version(version) {} std::vector>> bones; std::vector frames; std::vector channels; std::vector> chanKeys; float mainInterval = 0.0; void sendANIMToBlender(hecl::BlenderConnection::PyOutStream&, const CINF&, bool additive) const; }; struct ANIM0 : IANIM { DECL_EXPLICIT_DNA ANIM0() : IANIM(0) {} struct Header : BigDNA { DECL_DNA Value unkS; Value duration; Value unk0; Value interval; Value unk1; Value keyCount; Value unk2; Value boneSlotCount; }; }; struct ANIM1 : IANIM { DECL_EXPLICIT_DNA ANIM1() : IANIM(1) {} struct Header : BigDNA { DECL_DNA Value unk1; Value unk2; Value unk3; Value unk4[3]; Value translationMult; Value unk6; Value unk7; Value unk8; Value unk9; Value duration; Value keyCount; Value blobSize; Value unk10; Value floatsSize; Value flagsSize; Value initBlockSize; Value streamSize; Value unk11; Value boneCount; }; }; std::unique_ptr m_anim; void read(athena::io::IStreamReader& reader) { atUint32 version = reader.readUint32Big(); switch (version) { case 0: m_anim.reset(new struct ANIM0); m_anim->read(reader); break; case 1: m_anim.reset(new struct ANIM1); m_anim->read(reader); break; default: Log.report(logvisor::Fatal, "unrecognized ANIM version"); break; } } void write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(m_anim->m_version); m_anim->write(writer); } size_t binarySize(size_t __isz) const { return m_anim->binarySize(__isz + 4); } void sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, bool additive) const { m_anim->sendANIMToBlender(os, cinf, additive); } }; } } #endif // _DNAMP3_ANIM_HPP_