Browse Source

fix mesh-name error.

copycd 1 year ago
parent
commit
8648c2af45
1 changed files with 2 additions and 1 deletions
  1. 2 1
      code/AssetLib/Obj/ObjFileParser.cpp

+ 2 - 1
code/AssetLib/Obj/ObjFileParser.cpp

@@ -605,7 +605,8 @@ void ObjFileParser::getMaterialDesc() {
         }
         }
 
 
         if (needsNewMesh(strName)) {
         if (needsNewMesh(strName)) {
-            createMesh(strName);
+            auto newMeshName = m_pModel->mActiveGroup.empty() ? strName : m_pModel->mActiveGroup;
+            createMesh(newMeshName);
         }
         }
 
 
         m_pModel->mCurrentMesh->m_uiMaterialIndex = getMaterialIndex(strName);
         m_pModel->mCurrentMesh->m_uiMaterialIndex = getMaterialIndex(strName);