From 4adeae970902b1c1a21d6bdf2d077d812dab3fe3 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Fri, 13 Mar 2020 15:08:42 +0900 Subject: [PATCH] Skip counting the number of materials in target glTF if `materials` does not exist. --- examples/mesh-conv/sandbox/concat_mesh.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/mesh-conv/sandbox/concat_mesh.py b/examples/mesh-conv/sandbox/concat_mesh.py index 15ea297..a84c8cd 100644 --- a/examples/mesh-conv/sandbox/concat_mesh.py +++ b/examples/mesh-conv/sandbox/concat_mesh.py @@ -117,7 +117,10 @@ def main(): num_target_buffers = len(target["buffers"]) num_target_bufferViews = len(target["bufferViews"]) num_target_accessors = len(target["accessors"]) - num_target_materials = len(target["materials"]) + num_target_materials = 0 + if "materials" in target: + num_target_materials = len(target["materials"]) + print("num_target_meshes: ", num_target_meshes) print("num_target_buffers: ", num_target_buffers) print("num_target_bufferViews: ", num_target_bufferViews)