Added - Support for LOD meshes using _ , like LOD_0...

This commit is contained in:
Preben Eriksen
2022-09-25 10:31:25 +02:00
parent e98d2c8a27
commit ea9695ac16

View File

@@ -1552,10 +1552,14 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op
int32 ModelTool::DetectLodIndex(const String& nodeName)
{
const int32 index = nodeName.FindLast(TEXT("LOD"));
int32 index = nodeName.FindLast(TEXT("LOD"));
if (index != -1)
{
int32 num;
//PE: Many models use LOD_0... to indentify LOD levels.
if (nodeName.Length() > 4 && nodeName[3] == '_')
index++;
if (!StringUtils::Parse(nodeName.Get() + index + 3, &num))
{
if (num >= 0 && num < MODEL_MAX_LODS)