Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-01 06:11:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-01 06:11:16 +0300
commitb57533bc490f2a73b830b5477b31d5898f9e982c (patch)
tree785f2b2b0d0d2c47e3f14ad3715d8a22b545190b /io_scene_obj
parent0a18240d88fbd68b9d07a36d3ac2c5abf8088186 (diff)
fix for incorrect attributes, also use bump as map_bump.
Diffstat (limited to 'io_scene_obj')
-rw-r--r--io_scene_obj/import_obj.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py
index c69b8d97..27b0e8b1 100644
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@ -249,7 +249,7 @@ def obj_image_load(imagepath, DIR, IMAGE_SEARCH):
if image:
return image
- print("failed to load '%s' doesn't exist", imagepath)
+ print("failed to load %r doesn't exist" % imagepath)
return None
# def obj_image_load(imagepath, DIR, IMAGE_SEARCH):
@@ -303,8 +303,8 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
mtex.use_map_color_diffuse = True
mtex.use_map_alpha = True
- texture.mipmap = True
- texture.interpolation = True
+ texture.use_mipmap = True
+ texture.use_interpolation = True
texture.use_alpha = True
blender_material.use_transparency = True
blender_material.alpha = 0.0
@@ -351,6 +351,9 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
mtex.texture = texture
mtex.texture_coords = 'UV'
mtex.use_map_reflect = True
+
+ else:
+ raise Exception("invalid type '%s'" % type)
# 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'
@@ -414,7 +417,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
img_filepath = line_value(line.split())
if img_filepath:
load_material_image(context_material, context_material_name, img_filepath, 'Kd')
- elif line_lower.startswith('map_bump'):
+ elif line_lower.startswith('map_bump') or line_lower.startswith('bump'): # 'bump' is incorrect but some files use it.
img_filepath = line_value(line.split())
if img_filepath:
load_material_image(context_material, context_material_name, img_filepath, 'Bump')