forked from bartvdbraak/blender
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:
parent
39cb1432d8
commit
da31d2628e
@ -1041,8 +1041,7 @@ def load(operator, context, filepath,
|
|||||||
context_material= line_value(line.split())
|
context_material= line_value(line.split())
|
||||||
unique_materials[context_material]= None
|
unique_materials[context_material]= None
|
||||||
elif line.startswith('mtllib'): # usemap or usemat
|
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
|
# Nurbs support
|
||||||
elif line.startswith('cstype '):
|
elif line.startswith('cstype '):
|
||||||
|
Loading…
Reference in New Issue
Block a user