directX_blender
directX_blender copied to clipboard
image.use_premultiply bug fix
I got this error message in the Blender system console:
img = bel.image.new(path+'/'+filename)
File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_directx_bel\bel\image.py", line 44, in new
img.use_premultiply = premul
AttributeError: 'Image' object has no attribute 'use_premultiply'
Apparently .use_premultiply is not a possible image attribute in Blender 2.78, but I found a quick and simple bug fix for this issue. I just commented out these 4 lines in image.py and then this .x importer worked fine for me:
Line 44: # img.use_premultiply = premul
Line 163: # if type(img) != type(None) :
Line 164: # img.use_premultiply = True
Line 238: # img.use_premultiply = True
image.use_premultiply=True has been changed to
image.alpha_mode='PREMUL' # default is 'STRAIGHT'
The mode is set correctly from the x file in limemidolin's fork (and my fork which allows using Blender's GUI for installing the zip from GitHub).