#include "../Common/Common.h"
#define SAMPLE_FILENAME "UserProperties.fbx"
#define ANIM_STACK_ANIMATE_LIST "Animate Cube List"
#define ANIM_STACK_ANIMATE_CUBE "Animate Cube"
#define ANIM_STACK_ANIMATE_PYRAMID "Animate Pyramid"
void CreateUserProperties(
FbxNode *pNode);
 
int main(int argc, char** argv)
{
    bool lResult;
    
    InitializeSdkObjects(lSdkManager, lScene);
    
    FbxNode* lCube = CreateCube(lScene, 
"Cube");
 
    FbxNode* lPyramid = CreatePyramid(lScene, 
"Pyramid");
 
    
    
    CreateUserProperties(lCube);
    
    
    AnimateList(lScene, &p6);
    
    
    AnimateCube(lScene, lCube);
    
    AnimatePyramid(lScene, lPyramid);
    
    
    const char* lSampleFileName = 
NULL;
 
    for( int i = 1; i < argc; ++i )
    {
        if( FBXSDK_stricmp(argv[i], "-test") == 0 ) continue;
        else if( !lSampleFileName ) lSampleFileName = argv[i];
    }
    if( !lSampleFileName ) lSampleFileName = SAMPLE_FILENAME;
    if(lResult == false)
    {
        FBXSDK_printf("\n\nAn error occurred while saving the scene...\n");
        DestroySdkObjects(lSdkManager, lResult);
        return 0;
    }
    
    DestroySdkObjects(lSdkManager, lResult);
    return 0;
}
{
    typedef double Vector4[4];
    typedef double Vector2[2];
    
    static int vtxId[24] = {
        0,1,2,3, 
        1,5,6,2, 
        5,4,7,6, 
        4,0,3,7, 
        0,4,5,1, 
        3,2,6,7  
    };
    
    static Vector4 lControlPoints[8] = {
        { -50.0,  0.0,  50.0, 1.0}, {  50.0,  0.0,  50.0, 1.0}, {  50.0,100.0,  50.0, 1.0}, { -50.0,100.0,  50.0, 1.0}, 
        { -50.0,  0.0, -50.0, 1.0}, {  50.0,  0.0, -50.0, 1.0}, {  50.0,100.0, -50.0, 1.0}, { -50.0,100.0, -50.0, 1.0} 
    };
    
    static Vector4 lNormals[8] = {
        {-0.577350258827209,-0.577350258827209, 0.577350258827209, 1.0}, 
        { 0.577350258827209,-0.577350258827209, 0.577350258827209, 1.0}, 
        { 0.577350258827209, 0.577350258827209, 0.577350258827209, 1.0},
        {-0.577350258827209, 0.577350258827209, 0.577350258827209, 1.0}, 
        {-0.577350258827209,-0.577350258827209,-0.577350258827209, 1.0}, 
        { 0.577350258827209,-0.577350258827209,-0.577350258827209, 1.0},
        { 0.577350258827209, 0.577350258827209,-0.577350258827209, 1.0},
        {-0.577350258827209, 0.577350258827209,-0.577350258827209, 1.0}
    };
    
    
    memcpy((
void*)vertex, (
void*)lControlPoints, 8*
sizeof(
FbxVector4));
 
    
    int vId = 0;
    for (int f=0; f<6; f++)
    {
        for (int v=0; v<4; v++)
    }
    
    for (int n=0; n<8; n++)
    
    return lNode;
}
{
    int i, j;
    
    lControlPoints[0] = lControlPoint0;
    lControlPoints[1] = lControlPoint1;
    lControlPoints[2] = lControlPoint2;
    lControlPoints[3] = lControlPoint3;
    lControlPoints[4] = lControlPoint0;
    lControlPoints[5] = lControlPoint1;
    lControlPoints[6] = lControlPoint4;
    lControlPoints[7] = lControlPoint1;
    lControlPoints[8] = lControlPoint2;
    lControlPoints[9] = lControlPoint4;
    lControlPoints[10] = lControlPoint2;
    lControlPoints[11] = lControlPoint3;
    lControlPoints[12] = lControlPoint4;
    lControlPoints[13] = lControlPoint3;
    lControlPoints[14] = lControlPoint0;
    lControlPoints[15] = lControlPoint4;
    
    
    int lPolygonVertices[] = { 0, 3, 2, 1,
        4, 5, 6,
        7, 8, 9,
        10, 11, 12,
        13, 14, 15 };
    
    
    for(j = 0; j < 4; j++)
    {
    }
    
    for(i = 1; i < 5; i++)
    {
        for(j = 0; j < 3; j++)
        {
            lMesh->
AddPolygon(lPolygonVertices[4 + 3*(i - 1) + j]); 
 
        }
    }
    
    return lNode;
}
void CreateUserProperties(
FbxNode *pNode) {
 
    
    
    
    
    
    
    
    
}
{
    
    
    if (lFbxFCurveNode)
    {
        
        
        
    }
}
{
    
    
    
    lPositionConstraint->
AffectX = 
true;
 
    lPositionConstraint->
AffectY = 
true;
 
    lPositionConstraint->
AffectZ = 
true;
 
    
    FbxVector4 lOffset = lPositionConstrainedObj - lPositionSource;
 
    
    return lPositionConstraint;
}
{
    
    
    AnimateNode(pNode, lAnimLayer);
}
{
    
    
    AnimateNode(pNode, lAnimLayer);
}
{
    int lKeyIndex = 0;
    
    if (lCurveX)
    {
        lKeyIndex = lCurveX->
KeyAdd(lTime);
 
        lKeyIndex = lCurveX->
KeyAdd(lTime);
 
        lKeyIndex = lCurveX->
KeyAdd(lTime);
 
        lKeyIndex = lCurveX->
KeyAdd(lTime);
 
        lKeyIndex = lCurveX->
KeyAdd(lTime);
 
    }
    if (lCurveY)
    {
        lKeyIndex = lCurveY->
KeyAdd(lTime);
 
        lKeyIndex = lCurveY->
KeyAdd(lTime);
 
        lKeyIndex = lCurveY->
KeyAdd(lTime);
 
        lKeyIndex = lCurveY->
KeyAdd(lTime);
 
        lKeyIndex = lCurveY->
KeyAdd(lTime);
 
    }
    if (lCurveZ)
    {
        lKeyIndex = lCurveZ->
KeyAdd(lTime);
 
        lKeyIndex = lCurveZ->
KeyAdd(lTime);
 
        lKeyIndex = lCurveZ->
KeyAdd(lTime);
 
        lKeyIndex = lCurveZ->
KeyAdd(lTime);
 
        lKeyIndex = lCurveZ->
KeyAdd(lTime);
 
    }
}