#pragma once #include "DataSpec/DNACommon/DNACommon.hpp" #include "DataSpec/DNACommon/RigInverter.hpp" #include "DNAMP2.hpp" namespace DataSpec::DNAMP2 { struct CINF : BigDNA { AT_DECL_DNA Value boneCount; struct Bone : BigDNA { AT_DECL_DNA Value id; Value parentId; Value origin; Value q1; Value q2; Value linkedCount; Vector linked; }; Vector bones; Value boneIdCount; Vector boneIds; Value nameCount; struct Name : BigDNA { AT_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; template void sendCINFToBlender(hecl::blender::PyOutStream& os, const typename PAKBridge::PAKType::IDType& cinfId) const; template static std::string GetCINFArmatureName(const UniqueID& 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); template static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const typename PAKBridge::PAKType::Entry& entry, bool force, hecl::blender::Token& btok, std::function fileChanged); static bool Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const hecl::blender::Armature& armature); }; } // namespace DataSpec::DNAMP2