void Model::FindMeshes( KFbxNode *root ) {
	if( root ) {
		for(int i = 0; i < root->GetChildCount(); i++) {
			KFbxNode *pood = root->GetChild(i);
			int ac = pood->GetNodeAttributeCount();
			for( int j = 0; j < ac; j++ ) {
				KFbxNodeAttribute* poody = pood->GetNodeAttributeByIndex(j);
				if( poody->GetAttributeType() == KFbxNodeAttribute::eMESH ) {
					printf( " found a mesh !\n" );
					MeshNodes.push_back( pood );
					KFbxGeometryConverter converter(pood->GetFbxSdkManager());

					printf( " triangulating...\n" );
					converter.TriangulateInPlace(pood);

					
					
					//return pood;
				}
				
			}

			FindMeshes(pood);
			//return DumbRecursiveSearch( pood );
		}
	} 
}
示例#2
0
// Print a Node
void FBXParser::printNode(KFbxNode const & n){
  printTabs();
  const char * nodeName = n.GetName();

  fbxDouble3 tra = n.LclTranslation.Get();
  fbxDouble3 rot = n.LclRotation.Get();
  fbxDouble3 sca = n.LclScaling.Get();

  // Print node contents
  cout << "<node name = " << nodeName << "   ";
  cout << "translation = (" << tra[0] << ", " << tra[1] << ", " << tra[2] << ")" << "  ";
  cout << "rotation = (" << rot[0] << ", " << rot[1] << ", " << rot[2] << ")" << "  ";
  cout << "scaling = (" << sca[0] << ", " << sca[1] << ", " << sca[2] << ")" << endl;
  cout << "test 0" << endl;
  cout << "numTabs" << numTabs << endl;
  numTabs++;

  // Print node attributes
  for(int i=0; i < n.GetNodeAttributeCount(); i++){
    printAttribute(*n.GetNodeAttributeByIndex(i));
  }

  // Print children recursively
  for(int j = 0; j < n.GetChildCount(); j++){
    printNode(*n.GetChild(j));
  }

  numTabs--;
  printTabs();
  cout << "</node>" << endl;
}