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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user