From 446b0fde0667e84ef4237ef097642984c1f44806 Mon Sep 17 00:00:00 2001 From: John Senneker Date: Tue, 9 May 2017 11:52:40 -0400 Subject: [PATCH] Don't assign MTL ambient map value to diffuse map. This fixes a bug in which a map_Ka statement appears after a map_Kd, in which case the former will be assigned as the diffuse map of the imported mesh, when it should be the latter. --- wrap/io_trimesh/import_obj.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 5cb9258c..ae4fc2f6 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -1057,7 +1057,7 @@ namespace vcg { //currentMaterial.bSpecular = (illumination == 2); currentMaterial.illum = illumination; } - else if( (header.compare("map_Kd")==0) || (header.compare("map_Ka")==0) ) // texture name + else if(header.compare("map_Kd")==0) // texture name { std::string textureName; if (tokens.size() < 2) @@ -1065,7 +1065,7 @@ namespace vcg { else if (tokens.size() == 2) textureName = tokens[1]; //play it safe else - textureName = line.substr(7); //get everything after "map_Kd " or "map_Ka " + textureName = line.substr(7); //get everything after "map_Kd " currentMaterial.map_Kd=textureName;