mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 06:35:52 +08:00
Merge branch 'master' of github.com:syoyo/tinygltf
This commit is contained in:
commit
5150a46072
18
tiny_gltf.h
18
tiny_gltf.h
@ -3743,8 +3743,22 @@ static bool ParsePbrMetallicRoughness(PbrMetallicRoughness *pbr,
|
||||
static bool ParseMaterial(Material *material, std::string *err, const json &o) {
|
||||
ParseStringProperty(&material->name, err, o, "name", /* required */ false);
|
||||
|
||||
ParseNumberArrayProperty(&material->emissiveFactor, err, o, "emissiveFactor",
|
||||
/* required */ false);
|
||||
if(ParseNumberArrayProperty(&material->emissiveFactor, err, o, "emissiveFactor",
|
||||
/* required */ false)) {
|
||||
if (material->emissiveFactor.size() != 3) {
|
||||
if (err) {
|
||||
(*err) +=
|
||||
"Array length of `emissiveFactor` parameter in "
|
||||
"material must be 3, but got " +
|
||||
std::to_string(material->emissiveFactor.size()) + "\n";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// fill with default values
|
||||
material->emissiveFactor = {0.0, 0.0, 0.0};
|
||||
}
|
||||
|
||||
ParseStringProperty(&material->alphaMode, err, o, "alphaMode",
|
||||
/* required */ false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user