From 6143c6662b1696bf3abd792148d4b16234bc1549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Mon, 2 Sep 2019 13:41:59 +0200 Subject: [PATCH 1/2] don't fail if a scene has no nodes property (which is not required) --- tiny_gltf.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 62c466d..67ed245 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -4563,9 +4563,7 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn, } const json &o = it->get(); std::vector nodes; - if (!ParseIntegerArrayProperty(&nodes, err, o, "nodes", false)) { - return false; - } + ParseIntegerArrayProperty(&nodes, err, o, "nodes", false)); Scene scene; scene.nodes = std::move(nodes); From ce25385eab64fa29da300aee602101db24b11c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Mon, 2 Sep 2019 13:43:24 +0200 Subject: [PATCH 2/2] remove extra parenthesis --- tiny_gltf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 67ed245..0719dd9 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -4563,7 +4563,7 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn, } const json &o = it->get(); std::vector nodes; - ParseIntegerArrayProperty(&nodes, err, o, "nodes", false)); + ParseIntegerArrayProperty(&nodes, err, o, "nodes", false); Scene scene; scene.nodes = std::move(nodes);