Fix [#23612] OBJ import with imports double textures

Reported by Reiner Prokein

A .obj file can have multiple mtllib statements with the same name. Ensure that only one occurance is saved, so we don't get multiple entries from same material.

Also fix tabs -> spaces
This commit is contained in:
Nathan Letwory 2010-09-01 14:49:34 +00:00
parent 39cb1432d8
commit da31d2628e

@ -1041,8 +1041,7 @@ def load(operator, context, filepath,
context_material= line_value(line.split())
unique_materials[context_material]= None
elif line.startswith('mtllib'): # usemap or usemat
material_libs.extend( line.split()[1:] ) # can have multiple mtllib filenames per line
material_libs = list(set(material_libs) | set(line.split()[1:])) # can have multiple mtllib filenames per line, mtllib can appear more than once, so make sure only occurance of material exists
# Nurbs support
elif line.startswith('cstype '):