Created
February 16, 2020 07:51
-
-
Save fereria/39182264a7e5427f184eadbfbccc47f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 参照渡しで指定ノード以下のTreeをnodeArrayに取得 | |
void Test(FbxNode *pNode, FbxArray<FbxNode *> &nodeArray) | |
{ | |
nodeArray.Add(pNode); | |
int childNodeNum = pNode->GetChildCount(); | |
for (int i = 0; i < childNodeNum; i++) | |
{ | |
FbxNode *pChild = pNode->GetChild(i); | |
Test(pChild,nodeArray); | |
} | |
} | |
void fbxTest_03() | |
{ | |
/* | |
FbxArrayの使い方 | |
*/ | |
char *fbxFile = "D:/work/data_sample/xbot.fbx"; | |
FbxManager *manager = FbxManager::Create(); | |
FbxIOSettings *ioSettings = FbxIOSettings::Create(manager, IOSROOT); | |
FbxImporter *importer = FbxImporter::Create(manager, ""); | |
importer->Initialize(fbxFile, -1, manager->GetIOSettings()); | |
// Fbxにシーンをロード | |
FbxScene *scene = FbxScene::Create(manager, "scene"); | |
importer->Import(scene); | |
importer->Destroy(); | |
FbxNode *rootNode = scene->GetRootNode(); | |
FbxArray<FbxNode*>* fbxArray = new FbxArray<FbxNode*>(); | |
Test(rootNode, *fbxArray); | |
cout << fbxArray->Size() << endl; | |
for(int i = 0; i < fbxArray->Size();i++) | |
{ | |
printNode(fbxArray->GetAt(i)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment