fix load obj texture filename when has any option

This commit is contained in:
alemuntoni 2021-07-08 12:56:06 +02:00
parent a282947a72
commit 735f93c256
1 changed files with 130 additions and 130 deletions

View File

@ -1049,10 +1049,10 @@ public:
std::string textureName; std::string textureName;
if (tokens.size() < 2) if (tokens.size() < 2)
return false; return false;
else if (tokens.size() == 2) else {
textureName = tokens[1]; //play it safe //the tex name is the last one (after any option)
else textureName = tokens[tokens.size()-1];
textureName = line.substr(7); //get everything after "map_Kd " }
currentMaterial.map_Kd=textureName; currentMaterial.map_Kd=textureName;