Browse Source

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 14 years ago
parent
commit
93c2ed9474
1 changed files with 4 additions and 2 deletions
  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: