Debug. Debug. Step through. Print matrices. Wait... all the keyframes have the same transforms. What? Oh! Am I serializing out BoneTransform[0] instead of BoneTransform[i]? No... no because all the time deltas are correct.
It must be in the keyframe generation code. Damn, what did I change in there? Hmmm... well I changed the animation's name to something more reasonable than "Take001". But that wouldn't affe-- oh wait:
//Should be lTakeNames[i]->Buffer(),
//but this is always dumb: "Take001".
lAnimation->SetName(lFile.FileName());
//...
//Recalculate the animations of each bone:
for(unsigned j = 0; j < mSkeleton->mFbxBones.size(); ++j)
{
CalculateKeyFrames(mSkeleton->mFbxBones[j],
lAnimation.GetName().c_str(),
lAnimation->GetTimelines()[j],
mAxisConvertor,
lStart,
lKeyFrameTimes);
}
Shit, it's using the file name to request keyframe data instead of the take name...
//Should be lTakeNames[i]->Buffer(),
//but this is always dumb: "Take001".
lAnimation->SetName(lFile.FileName());
//...
//Recalculate the animations of each bone:
for(unsigned j = 0; j < mSkeleton->mFbxBones.size(); ++j)
{
CalculateKeyFrames(mSkeleton->mFbxBones[j],
//vvv THIS LINE DOWN HERE CHANGED
lTakeName[i]->Buffer(),
lAnimation->GetTimelines()[j],
mAxisConvertor,
lStart,
lKeyFrameTimes);
}
Yes! That fixed it! ... WAIT... why the HELL did the FBX SDK not throw any warnings or assertions that I was requesting a take that didn't exist. It crashes on almost anything else that goes awry; why not this? Instead it repeatedly gave me the first keyframe on the global timeline.
Thanks, API.
No comments:
Post a Comment