Parsing validation for mesh UV when NULL

This commit is contained in:
Antoine Pilote
2023-07-07 17:22:08 -04:00
parent 64e3acc48c
commit fad2259912

View File

@@ -163,9 +163,16 @@ namespace Nuake
for (auto& v : j["Vertices"])
{
Vertex vertex;
try {
DESERIALIZE_VEC2(v["UV"], vertex.uv)
}
catch(std::exception& e) {
vertex.uv = { 0.0, 0.0 };
}
DESERIALIZE_VEC3(v["Position"], vertex.position)
DESERIALIZE_VEC3(v["Normal"], vertex.normal)
DESERIALIZE_VEC2(v["UV"], vertex.uv)
DESERIALIZE_VEC3(v["Tangent"], vertex.tangent)
DESERIALIZE_VEC3(v["Bitangent"], vertex.bitangent)