-
Notifications
You must be signed in to change notification settings - Fork 0
/
DisplayMarker.cxx
92 lines (76 loc) · 2.92 KB
/
DisplayMarker.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
82
83
84
85
86
87
88
89
90
91
92
/****************************************************************************************
Copyright (C) 2014 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 <fbxsdk.h>
#include "DisplayCommon.h"
void DisplayMarker(FbxNode* pNode)
{
FbxMarker* lMarker = (FbxMarker*)pNode->GetNodeAttribute();
FbxString lString;
DisplayString("Marker Name: ", (char *) pNode->GetName());
DisplayMetaDataConnections(lMarker);
// Type
lString = " Marker Type: ";
switch (lMarker->GetType())
{
case FbxMarker::eStandard: lString += "Standard"; break;
case FbxMarker::eOptical: lString += "Optical"; break;
case FbxMarker::eEffectorIK: lString += "IK Effector"; break;
case FbxMarker::eEffectorFK: lString += "FK Effector"; break;
}
DisplayString(lString.Buffer());
// Look
lString = " Marker Look: ";
switch (lMarker->Look.Get())
{
default:
break;
case FbxMarker::eCube: lString += "Cube"; break;
case FbxMarker::eHardCross: lString += "Hard Cross"; break;
case FbxMarker::eLightCross: lString += "Light Cross"; break;
case FbxMarker::eSphere: lString += "Sphere"; break;
}
DisplayString(lString.Buffer());
// Size
lString = FbxString(" Size: ") + FbxString(lMarker->Size.Get());
DisplayString(lString.Buffer());
// Color
FbxDouble3 c = lMarker->Color.Get();
FbxColor color(c[0], c[1], c[2]);
DisplayColor(" Color: ", color);
// IKPivot
Display3DVector(" IKPivot: ", lMarker->IKPivot.Get());
}
// Example of getting FK/IK data from Node and setting it to the FbxControlSet class.
FbxControlSet ExampleControlSet(FbxNode* pNode)
{
FbxMarker* lMarker = (FbxMarker*)pNode->GetNodeAttribute();
FbxCharacter* lkFbxCharacter;
FbxControlSet lKFbxControlSet;
FbxEffector* lkFbxEffector=new FbxEffector();
FbxControlSetLink* lkFbxControlSetLink=new FbxControlSetLink();
int NodeId,NodeSubId;
int CharacterLinkType;
// Get Type of pNode and Set Node.
switch (lMarker ->GetType())
{
case FbxMarker::eEffectorIK:
pNode->GetCharacterLink(0,&lkFbxCharacter,&CharacterLinkType,&NodeId,&NodeSubId);
lFbxControlSet.SetEffector((EEffectorNodeId)NodeId,lkFbxEffector);
break;
case FbcMarker::eEffectorFK:
pNode->GetCharacterLink(0,&lkFbxCharacter,&CharacterLinkType,&NodeId,&NodeSubId);
lFbxControlSet.SetControlSetLink((ECharacterNodeId)NodeId,lkFbxControlSetLink)
break;
default :
break;
}
//If you want to make the part visible, set it true, else false.
lkFbxEffector.mShow=true;//IK
lkFbxControlSetLink.mShow=true;//FK
return lkControlSet;
}