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

SLERP PoseBone exporting for supported blender builds

This commit is contained in:
Jack Andersen
2016-04-25 14:47:48 -10:00
parent 57775d31bf
commit ca37657dbd
12 changed files with 173 additions and 141 deletions

View File

@@ -69,7 +69,8 @@ void CINF::sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const Uni
"bone.head = (%f,%f,%f)\n"
"bone.tail = (%f,%f,%f)\n"
"bone.use_inherit_scale = False\n"
"arm_bone_table[%u] = bone\n", getBoneNameFromId(bone.m_origBone.id)->c_str(),
"arm_bone_table[%u] = bone\n",
getBoneNameFromId(bone.m_origBone.id)->c_str(),
bone.m_origBone.origin.vec[0], bone.m_origBone.origin.vec[1], bone.m_origBone.origin.vec[2],
bone.m_tail[0], bone.m_tail[1], bone.m_tail[2],
bone.m_origBone.id);
@@ -79,6 +80,11 @@ void CINF::sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const Uni
os.format("arm_bone_table[%u].parent = arm_bone_table[%u]\n", bone.id, bone.parentId);
os << "bpy.ops.object.mode_set(mode='OBJECT')\n";
const char* rotMode = os.getConnection().hasSLERP() ? "QUATERNION_SLERP" : "QUATERNION";
for (const DNAANIM::RigInverter<CINF>::Bone& bone : inverter.getBones())
os.format("arm_obj.pose.bones['%s'].rotation_mode = '%s'\n",
getBoneNameFromId(bone.m_origBone.id)->c_str(), rotMode);
}
std::string CINF::GetCINFArmatureName(const UniqueID32& cinfId)