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

In OBJ converter added handling of cases where there are no materials specified in OBJ file (which is different from having null materials or no MTL file).

alteredq 15 лет назад
Родитель
Сommit
93c2ed9474
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      utils/exporters/convert_obj_threejs.py

+ 4 - 2
utils/exporters/convert_obj_threejs.py

@@ -756,8 +756,10 @@ def convert(infile, outfile):
             
 
     # default materials with debug colors for when
-    # there is no specified MTL, if loading failed
-    # or there were null materials
+    # there is no specified MTL / MTL loading failed,
+    # or if there were no materials / null materials
+    if not materials:
+        materials = { 'default':0 }
     mtl = generate_mtl(materials)
     
     if mtllib:

粤ICP备19079148号