closes https://github.com/assimp/assimp/issues/1894: use mesh name to name exported obj node.

This commit is contained in:
kimkulling
2018-04-11 17:04:49 +02:00
parent 6a0dc071a9
commit 9ca32b2373
2 changed files with 30 additions and 32 deletions

View File

@@ -439,8 +439,14 @@ void ObjExporter::AddMesh(const aiString& name, const aiMesh* m, const aiMatrix4
void ObjExporter::AddNode(const aiNode* nd, const aiMatrix4x4& mParent) {
const aiMatrix4x4& mAbs = mParent * nd->mTransformation;
aiMesh *cm( nullptr );
for(unsigned int i = 0; i < nd->mNumMeshes; ++i) {
AddMesh(nd->mName, pScene->mMeshes[nd->mMeshes[i]], mAbs);
cm = pScene->mMeshes[nd->mMeshes[i]];
if (nullptr != cm) {
AddMesh(cm->mName, pScene->mMeshes[nd->mMeshes[i]], mAbs);
} else {
AddMesh(nd->mName, pScene->mMeshes[nd->mMeshes[i]], mAbs);
}
}
for(unsigned int i = 0; i < nd->mNumChildren; ++i) {