Просмотр исходного кода

Check gltf extension against lower() filename

CURA-6739
Jaime van Kessel 5 лет назад
Родитель
Сommit
0235ad6930
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      plugins/TrimeshReader/TrimeshReader.py

+ 1 - 1
plugins/TrimeshReader/TrimeshReader.py

@@ -89,7 +89,7 @@ class TrimeshReader(MeshReader):
         # try to figure out the format, but for GLTF, it loads it as a binary file with flags "rb", and the json.load()
         # doesn't like it. For some reason, this seems to happen with 3.5.7, but not 3.7.1. Below is a workaround to
         # pass a file object that has been opened with "r" instead "rb" to load a GLTF file.
-        if file_name.endswith(".gltf"):
+        if file_name.lower().endswith(".gltf"):
             mesh_or_scene = trimesh.load(open(file_name, "r", encoding = "utf-8"), file_type = "gltf")
         else:
             mesh_or_scene = trimesh.load(file_name)