don't fail if a scene has no nodes property (which is not required)

This commit is contained in:
Benjamin Schmithüsen
2019-09-02 13:41:59 +02:00
parent 19c394de3f
commit 3e8a0d9c55

View File

@@ -4563,9 +4563,7 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn,
}
const json &o = it->get<json>();
std::vector<int> nodes;
if (!ParseIntegerArrayProperty(&nodes, err, o, "nodes", false)) {
return false;
}
ParseIntegerArrayProperty(&nodes, err, o, "nodes", false));
Scene scene;
scene.nodes = std::move(nodes);