#ifndef _DNAMP3_CSKR_HPP_ #define _DNAMP3_CSKR_HPP_ #include "hecl/blender/BlenderConnection.hpp" #include "../DNACommon/DNACommon.hpp" #include "CINF.hpp" #include "../DNAMP2/CSKR.hpp" namespace Retro { namespace DNAMP3 { struct CSKR : BigDNA { DECL_DNA DNAFourCC magic; Value version; DNAMP2::CSKR data; Value matrixCount; struct MatrixBindings : BigDNA { DECL_DNA Value mtxs[10]; }; Vector mtxBindings; Value unkCount1; Vector unk1; Value unkCount2; Vector unk2; Value unkCount3; Vector unk3; Value unkCount4; Vector unk4; Value unkCount5; Vector unk5; const atInt16* getMatrixBank(size_t idx) const { return mtxBindings.at(idx).mtxs; } void weightVertex(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf, atInt16 skinIdx) const { if (skinIdx < 0) return; const DNAMP2::CSKR::SkinningRule& rule = data.skinningRules[skinIdx]; for (const DNAMP2::CSKR::SkinningRule::Weight& weight : rule.weights) os.format("vert[dvert_lay][%u] = %f\n", cinf.getBoneIdxFromId(weight.boneId), weight.weight); } }; } } #endif // _DNAMP3_CSKR_HPP_