From 137a7ca9993f6ed8cb9dc4c3cbfbd143cf5303c8 Mon Sep 17 00:00:00 2001 From: s00665032 Date: Fri, 13 Jan 2023 12:52:08 +0700 Subject: [PATCH] Missed serialization texture sampler name fixed. According to the glTF 2.0 specification it exists, the internal tinygltf structure contains 'name' field as well. --- tiny_gltf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tiny_gltf.h b/tiny_gltf.h index 2159a17..ead4f2c 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -7440,6 +7440,9 @@ static void SerializeGltfNode(const Node &node, json &o) { } static void SerializeGltfSampler(const Sampler &sampler, json &o) { + if (!sampler.name.empty()) { + SerializeStringProperty("name", sampler.name, o); + } if (sampler.magFilter != -1) { SerializeNumberProperty("magFilter", sampler.magFilter, o); }