From ad63bf748bc850670cd1b55a82c627f04fad6bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Fri, 16 Aug 2019 14:19:27 +0200 Subject: [PATCH 1/2] parse node weights --- tiny_gltf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tiny_gltf.h b/tiny_gltf.h index a8af40e..76374c0 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -3680,6 +3680,8 @@ static bool ParseNode(Node *node, std::string *err, const json &o) { node->children.clear(); ParseIntegerArrayProperty(&node->children, err, o, "children", false); + ParseNumberArrayProperty(&node->weights, err, o, "weights", false); + ParseExtensionsProperty(&node->extensions, err, o); ParseExtrasProperty(&(node->extras), o); From 74c3c10121ab22f77f2acf552c660f3a3246044f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Fri, 16 Aug 2019 14:24:26 +0200 Subject: [PATCH 2/2] serialize node weights --- tiny_gltf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tiny_gltf.h b/tiny_gltf.h index 76374c0..df132ee 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -5590,6 +5590,10 @@ static void SerializeGltfNode(Node &node, json &o) { SerializeNumberProperty("camera", node.camera, o); } + if (node.weights.size() > 0) { + SerializeNumberArrayProperty("weights", node.weights, o); + } + if (node.extras.Type() != NULL_TYPE) { SerializeValue("extras", node.extras, o); }