bugfix [#22974] OBJ import arrives without texture
This commit is contained in:
parent
d5346883dc
commit
4e62175989
@ -420,8 +420,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
|
|||||||
# Add an MTL with the same name as the obj if no MTLs are spesified.
|
# Add an MTL with the same name as the obj if no MTLs are spesified.
|
||||||
temp_mtl = os.path.splitext((os.path.basename(filepath)))[0] + '.mtl'
|
temp_mtl = os.path.splitext((os.path.basename(filepath)))[0] + '.mtl'
|
||||||
|
|
||||||
if os.path.exists(DIR + temp_mtl) and temp_mtl not in material_libs:
|
if os.path.exists(os.path.join(DIR, temp_mtl)) and temp_mtl not in material_libs:
|
||||||
# if sys.exists(DIR + temp_mtl) and temp_mtl not in material_libs:
|
|
||||||
material_libs.append( temp_mtl )
|
material_libs.append( temp_mtl )
|
||||||
del temp_mtl
|
del temp_mtl
|
||||||
|
|
||||||
@ -435,11 +434,9 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
|
|||||||
unique_material_images[None]= None, False
|
unique_material_images[None]= None, False
|
||||||
|
|
||||||
for libname in material_libs:
|
for libname in material_libs:
|
||||||
mtlpath= DIR + libname
|
mtlpath= os.path.join(DIR, libname)
|
||||||
if not os.path.exists(mtlpath):
|
if not os.path.exists(mtlpath):
|
||||||
# if not sys.exists(mtlpath):
|
print ("\tError Missing MTL: '%s'" % mtlpath)
|
||||||
#print '\tError Missing MTL: "%s"' % mtlpath
|
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
#print '\t\tloading mtl: "%s"' % mtlpath
|
#print '\t\tloading mtl: "%s"' % mtlpath
|
||||||
context_material= None
|
context_material= None
|
||||||
|
Loading…
Reference in New Issue
Block a user