metaforce/DataSpec/DNAMP1/CINF.hpp

57 lines
1.6 KiB
C++
Raw Normal View History

2015-08-11 23:32:02 +00:00
#ifndef _DNAMP1_CINF_HPP_
#define _DNAMP1_CINF_HPP_
#include "../DNACommon/DNACommon.hpp"
2016-04-07 03:40:25 +00:00
#include "../DNACommon/RigInverter.hpp"
2015-08-11 23:32:02 +00:00
2017-12-29 08:08:12 +00:00
namespace DataSpec::DNAMP1
2015-08-11 23:32:02 +00:00
{
struct CINF : BigDNA
{
DECL_DNA
Value<atUint32> boneCount;
struct Bone : BigDNA
{
DECL_DNA
Value<atUint32> id;
Value<atUint32> parentId;
Value<atVec3f> origin;
Value<atUint32> linkedCount;
Vector<atUint32, DNA_COUNT(linkedCount)> linked;
};
Vector<Bone, DNA_COUNT(boneCount)> bones;
Value<atUint32> boneIdCount;
Vector<atUint32, DNA_COUNT(boneIdCount)> boneIds;
Value<atUint32> nameCount;
struct Name : BigDNA
{
DECL_DNA
String<-1> name;
Value<atUint32> boneId;
};
Vector<Name, DNA_COUNT(nameCount)> names;
2015-08-13 07:29:00 +00:00
2016-04-14 03:32:27 +00:00
atUint32 getInternalBoneIdxFromId(atUint32 id) const;
atUint32 getBoneIdxFromId(atUint32 id) const;
const std::string* getBoneNameFromId(atUint32 id) const;
2017-12-29 08:08:12 +00:00
void sendVertexGroupsToBlender(hecl::blender::PyOutStream& os) const;
void sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& cinfId) const;
2016-04-14 03:32:27 +00:00
static std::string GetCINFArmatureName(const UniqueID32& cinfId);
2016-04-08 03:37:14 +00:00
2016-04-07 03:40:25 +00:00
CINF() = default;
2017-12-29 08:08:12 +00:00
using Armature = hecl::blender::Armature;
using BlenderBone = hecl::blender::Bone;
2016-04-07 03:40:25 +00:00
2017-12-29 08:08:12 +00:00
int RecursiveAddArmatureBone(const Armature& armature, const BlenderBone* bone, int parent, int& curId,
2016-04-14 03:32:27 +00:00
std::unordered_map<std::string, atInt32>& idMap, std::map<std::string, int>& nameMap);
2016-04-07 03:40:25 +00:00
2016-04-14 03:32:27 +00:00
CINF(const Armature& armature, std::unordered_map<std::string, atInt32>& idMap);
2015-08-11 23:32:02 +00:00
};
}
#endif // _DNAMP1_CINF_HPP_