From 3e8955faf58a04531d3c3d4124821b3da2ced7ef Mon Sep 17 00:00:00 2001 From: Daniel Hritzkiv Date: Mon, 18 Sep 2017 18:16:48 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20ignore=20rgba(1,1,1,1)=20color?= =?UTF-8?q?=20properties?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not ignore rgba(1,1,1,1) material properties when importing glTF1. While a white diffuse color may be the default value for a default assimp material, `1,1,1,1` is a very explicit color value for ambient/specular/emissive color properties. Closes #1434 --- code/glTFImporter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/glTFImporter.cpp b/code/glTFImporter.cpp index 1b5c953be..a1d8e0cd0 100644 --- a/code/glTFImporter.cpp +++ b/code/glTFImporter.cpp @@ -174,9 +174,7 @@ inline void SetMaterialColorProperty(std::vector& embeddedTexIdxs, Asset& r else { aiColor4D col; CopyValue(prop.color, col); - if (col.r != 1.f || col.g != 1.f || col.b != 1.f || col.a != 1.f) { - mat->AddProperty(&col, 1, pKey, type, idx); - } + mat->AddProperty(&col, 1, pKey, type, idx); } } @@ -672,7 +670,7 @@ void glTFImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOS //pScene->mFlags |= AI_SCENE_FLAGS_NON_VERBOSE_FORMAT; MakeVerboseFormatProcess process; process.Execute(pScene); - + if (pScene->mNumMeshes == 0) { pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;