瀏覽代碼

Blender JSON exporter: Fixes issue when exporting mesh materials with the 'Face Materials' checkbox checked but there are no face materials to export. (#8717) (#8782)

carlosanunes 9 年之前
父節點
當前提交
bf827deab4
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      utils/exporters/blender/addons/io_three/exporter/api/mesh.py

+ 4 - 0
utils/exporters/blender/addons/io_three/exporter/api/mesh.py

@@ -507,6 +507,10 @@ def materials(mesh, options):
     """
     logger.debug("mesh.materials(%s, %s)", mesh, options)
 
+    # sanity check
+    if not mesh.materials:
+        return []
+
     indices = []
     for face in mesh.tessfaces:
         if face.material_index not in indices: