fix for bpy_extras.image_utils.load_image() making a placeholder image when passed...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 9 Dec 2011 21:07:37 +0000 (21:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 9 Dec 2011 21:07:37 +0000 (21:07 +0000)
made OBJ import fail when the image was missing.

release/scripts/modules/bpy_extras/image_utils.py

index 52050b08bc7c8b9fff0d01c4923a95c85f4e0b15..6d02b2b7af99b2881f96c572a480fc3c3c488225 100644 (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