Now properly serialize and deserialize rigged models

This commit is contained in:
Antoine Pilote
2023-09-17 20:16:04 -04:00
parent dd66c15794
commit c0f1178e7d
7 changed files with 143 additions and 37 deletions

View File

@@ -71,6 +71,7 @@ namespace Nuake
if (this->Path != "")
{
j["Path"] = this->Path;
j["SkeletonNode"] = m_SkeletonRoot.Serialize();
}
else
{
@@ -86,10 +87,9 @@ namespace Nuake
for (auto& animation : m_Animations)
{
j["m_Animations"][a] = animation->Serialize();
a++;
}
}
END_SERIALIZE();
}
@@ -108,6 +108,13 @@ namespace Nuake
m_NumAnimation = m_Animations.size();
m_CurrentAnimation = 0;
if (j.contains("SkeletonNode"))
{
SkeletonNode skeletonNode;
skeletonNode.Deserialize(j["SkeletonNode"]);
m_SkeletonRoot = std::move(skeletonNode);
}
this->Path = j["Path"];
}
else