[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4028] trunk/py/scripts/addons/ io_scene_obj/import_obj.py: fix [#32637] OBJ Import Alpha Map Problem
Campbell Barton
ideasman42 at gmail.com
Tue Dec 4 02:15:18 CET 2012
Revision: 4028
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4028
Author: campbellbarton
Date: 2012-12-04 01:15:17 +0000 (Tue, 04 Dec 2012)
Log Message:
-----------
fix [#32637] OBJ Import Alpha Map Problem
Modified Paths:
--------------
trunk/py/scripts/addons/io_scene_obj/import_obj.py
Modified: trunk/py/scripts/addons/io_scene_obj/import_obj.py
===================================================================
--- trunk/py/scripts/addons/io_scene_obj/import_obj.py 2012-12-04 01:08:18 UTC (rev 4027)
+++ trunk/py/scripts/addons/io_scene_obj/import_obj.py 2012-12-04 01:15:17 UTC (rev 4028)
@@ -85,14 +85,18 @@
# 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()
More information about the Bf-extensions-cvs
mailing list