Hum I seem to have made it work (but anybody could share his/her experience with this, just in case, I am missing something I would appreciate):
- Downloaded the FBX SDK 2020 for SV2019 (would love if someone could explain the difference between this and Windows Store and Windows Universal App Platform?). Installed that in the folder where the executable lives (don't want to deal with $PATH for now).
- wrote simple FBX program as given in docs and create simple FBX file with a sphere in it (from Maya)
- ` clang++ -o fbx fbx.cpp -llibfbxsdk -I"D:/Program Files/Autodesk/FBX/FBX SDK/2020.3.2/include"/` in GitBash terminal on Windows 10 (again the lib files live where the ./fbx program lives).
./fbx
Name of the node pSphere1
That's it. I am little confused about the use of md or mt lib. If something could clarify this but, would appreciate.
#include <iostream>
#include <fbxsdk.h>
void PrintNode(FbxNode* pNode)
{
std::cerr << "Name of the node " << pNode->GetName() << std::endl;
}
int main(int argc, char **argv)
{
const char* lFilename = "./sphere.fbx";
FbxManager* lSdkManager = FbxManager::Create();
FbxIOSettings* ios = FbxIOSettings::Create(lSdkManager, IOSROOT);
lSdkManager->SetIOSettings(ios);
FbxImporter* lImporter = FbxImporter::Create(lSdkManager, "");
if (!lImporter->Initialize(lFilename, -1, lSdkManager->GetIOSettings())) {
throw std::runtime_error("call to FbxImporter failed");
}
FbxScene* lScene = FbxScene::Create(lSdkManager, "myScene");
lImporter->Import(lScene);
lImporter->Destroy();
FbxNode* lRootNode = lScene->GetRootNode();
if (lRootNode) {
for (int i = 0; i < lRootNode->GetChildCount(); ++i) {
PrintNode(lRootNode->GetChild(i));
}
}
lSdkManager->Destroy();
return 0;
}