Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. void AssimpLoader::WriteSubMeshesToJson(const aiNode* pNode, const aiScene * mScene, std::ofstream &myfile)
  2. {
  3. // if we have meshes
  4. if (pNode != nullptr)
  5. {
  6. // iterate over all meshes for this node
  7. for (unsigned int idx = 0; idx < pNode->mNumMeshes; ++idx)
  8. {
  9. if (!mQuietMode)
  10. {
  11. aiMesh *pAIMesh = mScene->mMeshes[pNode->mMeshes[idx]];
  12. std::string output = pAIMesh->mName.data;
  13. myfile << output;
  14. // write to disk
  15. Ogre::LogManager::getSingleton().logMessage("SubMesh " + std::to_string(idx) + " for mesh '" + Ogre::String(pNode->mName.data) + "'");
  16. }
  17. }
  18. }
  19.  
  20. // Traverse all child nodes of the current node instance
  21. for (unsigned int childIdx = 0; childIdx < pNode->mNumChildren; childIdx++)
  22. {
  23. const aiNode* pChildNode = pNode->mChildren[childIdx];
  24. WriteSubMeshesToJson(pChildNode, mScene, myfile);
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement