fix for bpy_extras.image_utils.load_image() making a placeholder image when passed a path in bytes.

made OBJ import fail when the image was missing.
This commit is contained in:
2011-12-09 21:07:37 +00:00
parent 71ea408c73
commit 82480e9995

View File

@@ -104,7 +104,10 @@ def load_image(imagepath,
return _image_load(nfilepath)
if place_holder:
image = bpy.data.images.new(bpy.path.basename(imagepath), 128, 128)
name = bpy.path.basename(imagepath)
if type(name) == bytes:
name = name.decode('utf-8', "replace")
image = bpy.data.images.new(name, 128, 128)
# allow the path to be resolved later
image.filepath = imagepath
return image