diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-09-20 21:11:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-09-20 21:11:45 +0400 |
commit | 2446288ad318e3096d16a648fdf9e4a10f700af5 (patch) | |
tree | 764ad16b51d0ccfe6ee4b9d04f2e5d6481f8bed3 /release/scripts/import_obj.py | |
parent | ac160e56aefdcd21a5d103d9571b7a1c748b25eb (diff) |
fix in MTL library loading, if none is spesified the same name as the OBJ is used.
Diffstat (limited to 'release/scripts/import_obj.py')
-rw-r--r-- | release/scripts/import_obj.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/release/scripts/import_obj.py b/release/scripts/import_obj.py index 374caa13cf5..3df0a67c425 100644 --- a/release/scripts/import_obj.py +++ b/release/scripts/import_obj.py @@ -61,6 +61,7 @@ def obj_image_load(imagepath, DIR, IMAGE_SEARCH): Mainly uses comprehensiveImageLoad but tries to replace '_' with ' ' for Max's exporter replaces spaces with underscores. ''' + if '_' in imagepath: image= BPyImage.comprehensiveImageLoad(imagepath, DIR, PLACE_HOLDER= False, RECURSIVE= IMAGE_SEARCH) if image: return image @@ -112,8 +113,8 @@ 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. temp_mtl= stripExt(stripPath(filepath))+ '.mtl' - if sys.exists(temp_mtl): - if temp_mtl not in material_libs: + + if sys.exists(DIR + temp_mtl) and temp_mtl not in material_libs: material_libs.append( temp_mtl ) del temp_mtl |