diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-04 05:15:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-04 05:15:17 +0400 |
commit | a7e025424149ecd0fe7084e08c84aea36032d353 (patch) | |
tree | 9a76c9303cbff328986b173a21af15689bf38d06 /io_scene_obj | |
parent | 23ead6420a35407e879713614d955a237b8c840c (diff) |
fix [#32637] OBJ Import Alpha Map Problem
Diffstat (limited to 'io_scene_obj')
-rw-r--r-- | io_scene_obj/import_obj.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index e02b293b..29873620 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -85,14 +85,18 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_ # Absolute path - c:\.. etc would work here image = obj_image_load(imagepath, DIR, use_image_search) has_data = False + image_depth = 0 if image: texture.image = image + # note, this causes the image to load, see: [#32637] + # which makes the following has_data work as expected. + image_depth = image.depth has_data = image.has_data # Adds textures for materials (rendering) if type == 'Kd': - if has_data and image.depth == 32: + if image_depth in {32, 128}: # Image has alpha mtex = blender_material.texture_slots.add() |