diff --git a/src/texturegenerator.cpp b/src/texturegenerator.cpp index 1da7c723..8c79de3d 100644 --- a/src/texturegenerator.cpp +++ b/src/texturegenerator.cpp @@ -172,9 +172,8 @@ void TextureGenerator::prepare() materialId = QUuid(materialIdIt->second); QUuid partId = QUuid(partIt.first); updatedMaterialIdMap.insert({partId, materialId}); - auto countershadedIt = partIt.second.find("countershaded"); - if (countershadedIt != partIt.second.end()) - updatedCountershadedMap.insert({partId, isTrueValueString(countershadedIt->second)}); + updatedCountershadedMap.insert({partId, + isTrueValueString(valueOfKeyInMapOrEmpty(partIt.second, "countershaded"))}); } for (const auto &bmeshNode: m_outcome->nodes) {