[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42542] trunk/blender/release/scripts/ modules/bpy_extras/image_utils.py: fix for bpy_extras.image_utils. load_image() making a placeholder image when passed a path in bytes.

Campbell Barton ideasman42 at gmail.com
Fri Dec 9 22:07:38 CET 2011


Revision: 42542
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42542
Author:   campbellbarton
Date:     2011-12-09 21:07:37 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy_extras/image_utils.py

Modified: trunk/blender/release/scripts/modules/bpy_extras/image_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_extras/image_utils.py	2011-12-09 20:29:21 UTC (rev 42541)
+++ trunk/blender/release/scripts/modules/bpy_extras/image_utils.py	2011-12-09 21:07:37 UTC (rev 42542)
@@ -104,7 +104,10 @@
                 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




More information about the Bf-blender-cvs mailing list