From 60bfde78eba2e677e356e02147c8e53c407e1cc7 Mon Sep 17 00:00:00 2001 From: ruyo Date: Sun, 21 Nov 2021 23:23:22 +0900 Subject: [PATCH] Fixed an incorrect indeiciesType in the glTF2 sparse accessor. --- code/AssetLib/glTF2/glTF2Asset.inl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index b570fc8e6..e0a505297 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -863,6 +863,9 @@ inline void Accessor::Read(Value &obj, Asset &r) { //indices componentType sparse->indicesType = MemberOrDefault(*indicesValue, "componentType", ComponentType_BYTE); //sparse->indices->Read(*indicesValue, r); + } else { + // indicesType + sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT); } // value @@ -875,8 +878,6 @@ inline void Accessor::Read(Value &obj, Asset &r) { //sparse->values->Read(*valuesValue, r); } - // indicesType - sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT); const unsigned int elementSize = GetElementSize(); const size_t dataSize = count * elementSize;