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-11-24 01:23:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-24 01:23:04 +0400
commit97b83344a739a446f13e6de2c8cddb218095b94b (patch)
tree4f20961592fc6216f18dbed04363f53b0130e417
parentac42e26c9dd50bf89b47874424b1fd96c6c8cd49 (diff)
fix [#29375] Obj Import fails
-rw-r--r--io_scene_obj/import_obj.py36
1 files changed, 9 insertions, 27 deletions
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py
index ae3b87a2..b5d70de7 100644
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@ -55,35 +55,17 @@ def line_value(line_split):
return b' '.join(line_split[1:])
-def obj_image_load(imagepath, DIR, use_image_search):
+def obj_image_load(imagepath, DIR, recursive):
+ '''
+ Mainly uses comprehensiveImageLoad
+ but tries to replace '_' with ' ' for Max's exporter replaces spaces with underscores.
+ '''
if b'_' in imagepath:
- image = load_image(imagepath.replace(b'_', b' '), DIR)
+ image = load_image(imagepath.replace(b'_', b' '), DIR, recursive=recursive)
if image:
return image
- image = load_image(imagepath, DIR)
- if image:
- return image
-
- print("failed to load %r doesn't exist" % imagepath)
- return None
-
-# def obj_image_load(imagepath, DIR, use_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= use_image_search)
-# if image: return image
-# # Did the exporter rename the image?
-# image= BPyImage.comprehensiveImageLoad(imagepath.replace('_', ' '), DIR, PLACE_HOLDER= False, RECURSIVE= use_image_search)
-# if image: return image
-
-# # Return an image, placeholder if it dosnt exist
-# image= BPyImage.comprehensiveImageLoad(imagepath, DIR, PLACE_HOLDER= True, RECURSIVE= use_image_search)
-# return image
+ return load_image(imagepath, DIR, recursive=recursive, place_holder=True)
def create_materials(filepath, material_libs, unique_materials, unique_material_images, use_image_search):
@@ -124,6 +106,8 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
texture.use_alpha = True
blender_material.use_transparency = True
blender_material.alpha = 0.0
+
+ blender_material.game_settings.alpha_blend = 'ALPHA'
else:
mtex = blender_material.texture_slots.add()
mtex.texture = texture
@@ -619,8 +603,6 @@ def create_mesh(new_objects,
image, has_data = unique_material_images[context_material]
if image: # Can be none if the material dosnt have an image.
blender_tface.image = image
- if has_data and image.depth == 32:
- blender_tface.alpha_blend = 'ALPHA'
# BUG - Evil eekadoodle problem where faces that have vert index 0 location at 3 or 4 are shuffled.
if len(face_vert_loc_indices) == 4: