Animating the cubes
 
 
 

CreateScene() calls CreateCube(), which calls CreateCubeDetailed(), which calls AnimateCube() only if the user has selected Animation in the UI:

    if(pAnimate)
    {
        AnimateCube(lCube, gTakeName, pRotateAxe);
    }

You can animate meshes, NURBS, lights, cameras—any instance of a subclass of KFbxNodeAttribute. See Animating the camera.

// The cube rotate on X or Y or Z.
void AnimateCube(KFbxNode* pCube, KString pTakeName, int pRotAxe)
{
    KFCurve* lCurve = NULL;
    KTime lTime;
    int lKeyIndex = 0;
 
    pCube->CreateTakeNode(pTakeName.Buffer());
    pCube->SetCurrentTakeNode(pTakeName.Buffer());
    pCube->LclRotation.GetKFCurveNode(true, pTakeName.Buffer());
 
    if(pRotAxe == 0)
        lCurve = pCube->LclRotation.GetKFCurve(KFCURVENODE_R_X,
 pTakeName.Buffer());
    else if(pRotAxe == 1)
         lCurve = pCube->LclRotation.GetKFCurve(KFCURVENODE_R_Y,
 pTakeName.Buffer());
    else if(pRotAxe == 2)
         lCurve = pCube->LclRotation.GetKFCurve(KFCURVENODE_R_Z, pTakeName.Buffer());
 
    if (lCurve)
    {
        lCurve->KeyModifyBegin();
 
        lTime.SetSecondDouble(0.0);
        lKeyIndex = lCurve->KeyAdd(lTime);
        lCurve->KeySet(lKeyIndex, lTime, 0.0, KFCURVE_INTERPOLATION_LINEAR);
 
        lTime.SetSecondDouble(20.0);
        lKeyIndex = lCurve->KeyAdd(lTime);
        lCurve->KeySet(lKeyIndex, lTime, -3500, KFCURVE_INTERPOLATION_LINEAR);
        lCurve->KeyModifyEnd();
    }
}