#ifndef _DNAMP1_CINF_HPP_ #define _DNAMP1_CINF_HPP_ #include "../DNACommon/DNACommon.hpp" #include "../DNACommon/RigInverter.hpp" namespace DataSpec::DNAMP1 { struct CINF : BigDNA { DECL_DNA Value boneCount; struct Bone : BigDNA { DECL_DNA Value id; Value parentId; Value origin; Value linkedCount; Vector linked; }; Vector bones; Value boneIdCount; Vector boneIds; Value nameCount; struct Name : BigDNA { DECL_DNA String<-1> name; Value boneId; }; Vector names; atUint32 getInternalBoneIdxFromId(atUint32 id) const; atUint32 getBoneIdxFromId(atUint32 id) const; const std::string* getBoneNameFromId(atUint32 id) const; void sendVertexGroupsToBlender(hecl::blender::PyOutStream& os) const; void sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& cinfId) const; static std::string GetCINFArmatureName(const UniqueID32& cinfId); CINF() = default; using Armature = hecl::blender::Armature; using BlenderBone = hecl::blender::Bone; int RecursiveAddArmatureBone(const Armature& armature, const BlenderBone* bone, int parent, int& curId, std::unordered_map& idMap, std::map& nameMap); CINF(const Armature& armature, std::unordered_map& idMap); }; } #endif // _DNAMP1_CINF_HPP_