|
Dear Viviane!
Thanks a ton for your reply! :)
So the changed code is bellow, and you want, you can find the fbx files (the one that is loaded in the beginning, and the one that is generated) here: http://www.mpi-inf.mpg.de/~ajain/fbx/
I would really appreciate if you look into it.
Thanks a lot in advance!
Kind regards,
Arjun
mAnimModel.saveModel("data/tmp/tmpAnim.fbx");
LoadScene(mAnimShapeFamily.getSDKManager(), mAnimSceneFBX, "data/tmp/tmpAnim.fbx");
KFbxAnimStack* myAnimStack = KFbxAnimStack::Create(mAnimSceneFBX, "My stack");
KFbxAnimLayer* myAnimBaseLayer = KFbxAnimLayer::Create(mAnimSceneFBX, "Layer0");
myAnimStack->AddMember(myAnimBaseLayer);
tree <treeNode> const & currTree = mAnimModel.getTree();
tree <treeNode>::iterator it = currTree.begin();
//for(; it != currTree.end(); it++)
{
KFbxNode *node = mAnimSceneFBX->FindNodeByName(it->mPartName.c_str());
printf("\n%s[%s]", it->mPartName.c_str(), it->mTreeKey.c_str()); //Prints body
KFbxAnimCurveNode *myAnimCurvenode = node->LclScaling.GetCurveNode(myAnimBaseLayer, true);
KFbxAnimCurve* myTranXCurve = NULL;
KTime myTime;
myTranXCurve = node->LclScaling.GetCurve<KFbxAnimCurve>(myAnimBaseLayer, KFCURVENODE_S_X, true);
myTranXCurve->KeyModifyBegin();
myTime.SetSecondDouble(0.0);
myTranXCurve->KeyAdd(myTime);
myTranXCurve->KeySetValue(0, 0.0);
myTranXCurve->KeySetInterpolation(0, KFbxAnimCurveDef::eINTERPOLATION_LINEAR);
myTime.SetSecondDouble(10.0);
myTranXCurve->KeyAdd(myTime);
myTranXCurve->KeySetValue(1, 10.0);
myTranXCurve->KeySetInterpolation(1, KFbxAnimCurveDef::eINTERPOLATION_LINEAR);
myTime.SetSecondDouble(20.0);
myTranXCurve->KeyAdd(myTime);
myTranXCurve->KeySetValue(2, 100.0);
myTranXCurve->KeySetInterpolation(2, KFbxAnimCurveDef::eINTERPOLATION_LINEAR);
myTime.SetSecondDouble(30.0);
myTranXCurve->KeyAdd(myTime);
myTranXCurve->KeySetValue(3, 10.0);
myTranXCurve->KeySetInterpolation(3, KFbxAnimCurveDef::eINTERPOLATION_LINEAR);
myTranXCurve->KeyModifyEnd();
}
SaveScene(mAnimShapeFamily.getSDKManager(), mAnimSceneFBX, "data/tmp/tmppp.fbx");
If you
Author: arjunjain
|