From 856d4c016ef0ad7434aee2c2c388bd5713a0f223 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 10 Nov 2020 10:03:09 +0100 Subject: [PATCH 1/2] closes https://github.com/assimp/assimp/issues/3448 Add transmission alpha value. if any. --- code/AssetLib/Obj/ObjFileMtlImporter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/Obj/ObjFileMtlImporter.cpp b/code/AssetLib/Obj/ObjFileMtlImporter.cpp index 6464a55e0..9e45a0ce2 100644 --- a/code/AssetLib/Obj/ObjFileMtlImporter.cpp +++ b/code/AssetLib/Obj/ObjFileMtlImporter.cpp @@ -137,10 +137,14 @@ void ObjFileMtlImporter::load() { } break; case 'T': { ++m_DataIt; - if (*m_DataIt == 'f') // Material transmission - { + // Material transmission color + if (*m_DataIt == 'f') { ++m_DataIt; getColorRGBA(&m_pModel->m_pCurrentMaterial->transparent); + } else if (*m_DataIt == 'r') { + // Material transmission alpha value + ++m_DataIt; + getFloatValue(&m_pModel->m_pCurrentMaterial->alpha); } m_DataIt = skipLine(m_DataIt, m_DataItEnd, m_uiLine); } break; From a8381113ebefde1bd5a67fa4734a2932c4acece1 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 10 Nov 2020 10:23:28 +0100 Subject: [PATCH 2/2] Update ObjFileMtlImporter.cpp --- code/AssetLib/Obj/ObjFileMtlImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/Obj/ObjFileMtlImporter.cpp b/code/AssetLib/Obj/ObjFileMtlImporter.cpp index 9e45a0ce2..283735912 100644 --- a/code/AssetLib/Obj/ObjFileMtlImporter.cpp +++ b/code/AssetLib/Obj/ObjFileMtlImporter.cpp @@ -144,7 +144,7 @@ void ObjFileMtlImporter::load() { } else if (*m_DataIt == 'r') { // Material transmission alpha value ++m_DataIt; - getFloatValue(&m_pModel->m_pCurrentMaterial->alpha); + getFloatValue(m_pModel->m_pCurrentMaterial->alpha); } m_DataIt = skipLine(m_DataIt, m_DataItEnd, m_uiLine); } break;