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-05-10 10:43:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-10 10:43:14 +0400
commit371c55f5b4455e0df36fd08f16147dad64425bc1 (patch)
tree84c50584f062fa0121ab6b49869443e0968ffd7c /io_scene_obj
parent505eeb3b3104bd911683356026106f7a3b9b4958 (diff)
fix [#27332] Obj exporter doesent export bump, spec/ importer wrong shader settings
Diffstat (limited to 'io_scene_obj')
-rw-r--r--io_scene_obj/export_obj.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py
index 8d33accc..b2537696 100644
--- a/io_scene_obj/export_obj.py
+++ b/io_scene_obj/export_obj.py
@@ -70,7 +70,7 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict):
# Write material/image combinations we have used.
# Using mtl_dict.values() directly gives un-predictable order.
- for mtl_mat_name, mat, img in mtl_dict_values:
+ for mtl_mat_name, mat, face_img in mtl_dict_values:
# Get the Blender data for the material and the image.
# Having an image named None will make a bug, dont do it :)
@@ -106,22 +106,23 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict):
file.write('illum 2\n') # light normaly
# Write images!
- if img: # We have an image on the face!
+ if face_img: # We have an image on the face!
# write relative image path
- rel = io_utils.path_reference(img.filepath, source_dir, dest_dir, path_mode, "", copy_set)
+ rel = io_utils.path_reference(face_img.filepath, source_dir, dest_dir, path_mode, "", copy_set)
file.write('map_Kd %s\n' % rel) # Diffuse mapping image
- elif mat: # No face image. if we havea material search for MTex image.
+ if mat: # No face image. if we havea material search for MTex image.
image_map = {}
# backwards so topmost are highest priority
for mtex in reversed(mat.texture_slots):
if mtex and mtex.texture.type == 'IMAGE':
image = mtex.texture.image
if image:
+ # texface overrides others
+ if mtex.use_map_color_diffuse and face_img is None:
+ image_map["map_Kd"] = image
if mtex.use_map_ambient:
image_map["map_Ka"] = image
- if mtex.use_map_color_diffuse:
- image_map["map_Kd"] = image
if mtex.use_map_specular:
image_map["map_Ks"] = image
if mtex.use_map_alpha: