ExportScene03/MyKFbxMesh.cxx

/**************************************************************************************

 Copyright (C) 2001 - 2009 Autodesk, Inc. and/or its licensors.
 All Rights Reserved.

 The coded instructions, statements, computer programs, and/or related material 
 (collectively the "Data") in these files contain unpublished information 
 proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
 Canada and United States of America federal copyright law and by international 
 treaties. 
 
 The Data may not be disclosed or distributed to third parties, in whole or in
 part, without the prior written consent of Autodesk, Inc. ("Autodesk").

 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
 BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
 NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
 WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
 OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
 
 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
 OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
 SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
 OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
 HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
 FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
 ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
 WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
 OR DAMAGE. 

**************************************************************************************/
#include <fbxfilesdk/fbxfilesdk_def.h>

#include <fbxsdk.h>
#include "MyKFbxMesh.h"
#include <fbxfilesdk/fbxfilesdk_nsbegin.h>


KFBXOBJECT_IMPLEMENT(MyKFbxMesh);
KFBXOBJECT_IMPLEMENT(MyFbxObject);

const char* MyKFbxMesh::GetTypeName() const
{
    return "MyKFbxMesh";
}


MyKFbxMesh::MyKFbxMesh(KFbxSdkManager& pManager, char const* pName):KFbxMesh(pManager, pName)
{
    //Can't create properties here, its too soon yet :)
}

KFbxProperty MyKFbxMesh::GetProperty(int pId)
{
    KFbxProperty dummy;
    switch (pId)
    {
    case eMY_PROPERTY1 : return FindProperty("MyExtraPropertyBool");
    case eMY_PROPERTY2 : return FindProperty("MyExtraPropertyInteger");
    case eMY_PROPERTY3 : return FindProperty("MyExtraPropertyFloat");
    case eMY_PROPERTY4 : return FindProperty("MyExtraPropertyDouble");
    case eMY_PROPERTY5 : return FindProperty("MyExtraPropertyString");
    case eMY_PROPERTY6 : return FindProperty("MyExtraPropertyVector3");
    case eMY_PROPERTY7 : return FindProperty("MyExtraPropertyColor");
    case eMY_PROPERTY8 : return FindProperty("MyExtraPropertyVector4");
    case eMY_PROPERTY9 : return FindProperty("MyExtraPropertyMatrix4x4");
    case eMY_PROPERTY10: return FindProperty("MyExtraPropertyEnum");
    case eMY_PROPERTY11: return FindProperty("MyExtraPropertyTime");
    default:
        break;
    };

    return dummy;
}

void MyKFbxMesh::Destruct(bool pRecursive, bool pDependents)
{
    KFbxMesh::Destruct(pRecursive, pDependents);
}

bool MyKFbxMesh::ConstructProperties(bool pForceSet)
{
    KFbxProperty::Create(this, DTBool, "MyExtraPropertyBool", "MyExtraPropertyLabel1");
    KFbxProperty::Create(this, DTInteger, "MyExtraPropertyInteger", "MyExtraPropertyLabel2");
    KFbxProperty::Create(this, DTFloat, "MyExtraPropertyFloat", "MyExtraPropertyLabel3");
    KFbxProperty::Create(this, DTDouble, "MyExtraPropertyDouble", "MyExtraPropertyLabel4");
    KFbxProperty::Create(this, DTString, "MyExtraPropertyString", "MyExtraPropertyLabel5");
    KFbxProperty::Create(this, DTDouble3, "MyExtraPropertyVector3", "MyExtraPropertyLabel6");
    KFbxProperty::Create(this, DTColor3, "MyExtraPropertyColor", "MyExtraPropertyLabel7");
    KFbxProperty::Create(this, DTDouble4, "MyExtraPropertyVector4", "MyExtraPropertyLabel8");
    KFbxProperty::Create(this, DTDouble44, "MyExtraPropertyMatrix4x4", "MyExtraPropertyLabel9");
    KFbxProperty::Create(this, DTEnum, "MyExtraPropertyEnum", "MyExtraPropertyLabel10");
    KFbxProperty::Create(this, DTTime, "MyExtraPropertyTime", "MyExtraPropertyLabel11");

    //we must set the flag to eUSER if it is DTEnum or DTStringList
    this->GetProperty((int)eMY_PROPERTY10).ModifyFlag(KFbxProperty::eUSER, true);

    return ParentClass::ConstructProperties(pForceSet);
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

const char* MyFbxObject::GetTypeName() const
{
    return "MyFbxObject";
}

MyFbxObject::MyFbxObject(KFbxSdkManager& pManager, char const* pName) : KFbxObject(pManager, pName)
{
    //Can't create properties here, its too soon yet :)
}

void MyFbxObject::Destruct(bool pRecursive, bool pDependents)
{
    ParentClass::Destruct(pRecursive, pDependents);
}

bool MyFbxObject::ConstructProperties(bool pForceSet)
{
    KFbxProperty::Create(this, DTDouble, "MyAnimatedPropertyName", "MyFbxObject Animated Property Label");
    return ParentClass::ConstructProperties(pForceSet);
}

#include <fbxfilesdk/fbxfilesdk_nsend.h>