Material names are stored once in material.name, then duplicated in "additionalValues"

This patch prevent this duplication
This commit is contained in:
Arthur Brainville (Ybalrid) 2019-06-23 21:50:10 +02:00
parent 0ccc8dc262
commit dab0daaedf

View File

@ -3457,7 +3457,9 @@ static bool ParseMaterial(Material *material, std::string *err, const json &o) {
} else {
Parameter param;
if (ParseParameterProperty(&param, err, o, it.key(), false)) {
material->additionalValues[it.key()] = param;
// names of materials have already been parsed. Putting it in this map
// doesn't correctly reflext the glTF specification
if (it.key() != "name") material->additionalValues[it.key()] = param;
}
}
}