2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 01:07:43 +00:00

Migration to new ANIM extract

This commit is contained in:
Jack Andersen
2016-04-06 17:40:25 -10:00
parent cd8b6b6ed4
commit 9ee8840b54
29 changed files with 691 additions and 427 deletions

View File

@@ -9,7 +9,7 @@ namespace DNAMP3
using ANIMOutStream = hecl::BlenderConnection::PyOutStream::ANIMOutStream;
void ANIM::IANIM::sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, bool additive) const
void ANIM::IANIM::sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const DNAANIM::RigInverter<CINF>& rig, bool additive) const
{
os.format("act.hecl_fps = round(%f)\n"
"act.hecl_additive = %s\n",
@@ -18,7 +18,7 @@ void ANIM::IANIM::sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, co
auto kit = chanKeys.begin() + 1;
for (const std::pair<atUint32, std::tuple<bool,bool,bool>>& bone : bones)
{
const std::string* bName = cinf.getBoneNameFromId(bone.first);
const std::string* bName = rig.getCINF().getBoneNameFromId(bone.first);
if (!bName)
{
if (std::get<0>(bone.second))
@@ -45,11 +45,11 @@ void ANIM::IANIM::sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, co
if (std::get<1>(bone.second))
{
if (!additive)
os << "bone_trans_head = (0.0,0.0,0.0)\n"
"if arm_obj.data.bones[bone_string].parent is not None:\n"
" bone_trans_head = Vector(arm_obj.data.bones[bone_string].head_local) - Vector(arm_obj.data.bones[bone_string].parent.head_local)\n";
os << "#bone_trans_head = (0.0,0.0,0.0)\n"
"#if arm_obj.data.bones[bone_string].parent is not None:\n"
"# bone_trans_head = Vector(arm_obj.data.bones[bone_string].head_local) - Vector(arm_obj.data.bones[bone_string].parent.head_local)\n";
else
os << "bone_trans_head = (0.0,0.0,0.0)\n";
os << "#bone_trans_head = (0.0,0.0,0.0)\n";
os << "transCurves = []\n"
"transCurves.append(act.fcurves.new('pose.bones[\"'+bone_string+'\"].location', index=0, action_group=bone_string))\n"
"transCurves.append(act.fcurves.new('pose.bones[\"'+bone_string+'\"].location', index=1, action_group=bone_string))\n"