-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyKFbxMesh.cxx
81 lines (66 loc) · 3.35 KB
/
MyKFbxMesh.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/****************************************************************************************
Copyright (C) 2015 Autodesk, Inc.
All rights reserved.
Use of this software is subject to the terms of the Autodesk license agreement
provided at the time of installation or download, or which otherwise accompanies
this software in either electronic or hard copy form.
****************************************************************************************/
#include "MyKFbxMesh.h"
FBXSDK_OBJECT_IMPLEMENT(MyKFbxMesh);
FBXSDK_OBJECT_IMPLEMENT(MyFbxObject);
const char* MyKFbxMesh::GetTypeName() const
{
return "MyKFbxMesh";
}
FbxProperty MyKFbxMesh::GetProperty(int pId)
{
FbxProperty 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::ConstructProperties(bool pForceSet)
{
ParentClass::ConstructProperties(pForceSet);
FbxProperty::Create(this, FbxBoolDT, "MyExtraPropertyBool", "MyExtraPropertyLabel1");
FbxProperty::Create(this, FbxIntDT, "MyExtraPropertyInteger", "MyExtraPropertyLabel2");
FbxProperty::Create(this, FbxFloatDT, "MyExtraPropertyFloat", "MyExtraPropertyLabel3");
FbxProperty::Create(this, FbxDoubleDT, "MyExtraPropertyDouble", "MyExtraPropertyLabel4");
FbxProperty::Create(this, FbxStringDT, "MyExtraPropertyString", "MyExtraPropertyLabel5");
FbxProperty::Create(this, FbxDouble3DT, "MyExtraPropertyVector3", "MyExtraPropertyLabel6");
FbxProperty::Create(this, FbxColor3DT, "MyExtraPropertyColor", "MyExtraPropertyLabel7");
FbxProperty::Create(this, FbxDouble4DT, "MyExtraPropertyVector4", "MyExtraPropertyLabel8");
FbxProperty::Create(this, FbxDouble4x4DT, "MyExtraPropertyMatrix4x4", "MyExtraPropertyLabel9");
FbxProperty::Create(this, FbxEnumDT, "MyExtraPropertyEnum", "MyExtraPropertyLabel10");
FbxProperty::Create(this, FbxTimeDT, "MyExtraPropertyTime", "MyExtraPropertyLabel11");
//we must set the flag to eUser if it is FbxEnumDT or FbxStringListDT
this->GetProperty((int)eMY_PROPERTY10).ModifyFlag(FbxPropertyFlags::eUserDefined, true);
}
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
const char* MyFbxObject::GetTypeName() const
{
return "MyFbxObject";
}
void MyFbxObject::Destruct(bool pRecursive)
{
ParentClass::Destruct(pRecursive);
}
void MyFbxObject::ConstructProperties(bool pForceSet)
{
ParentClass::ConstructProperties(pForceSet);
FbxProperty::Create(this, FbxDoubleDT, "MyAnimatedPropertyName", "MyFbxObject Animated Property Label");
}