[Bf-blender-cvs] [dc2a01c] master: Fix T47360: Image loading fails when accessible from the CWD

Campbell Barton noreply at git.blender.org
Mon Feb 8 08:29:13 CET 2016


Commit: dc2a01ca059d160f748064167200f275cede40a7
Author: Campbell Barton
Date:   Mon Feb 8 18:19:50 2016 +1100
Branches: master
https://developer.blender.org/rBdc2a01ca059d160f748064167200f275cede40a7

Fix T47360: Image loading fails when accessible from the CWD

===================================================================

M	release/scripts/modules/bpy_extras/image_utils.py

===================================================================

diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py
index f197596..d078d63 100644
--- a/release/scripts/modules/bpy_extras/image_utils.py
+++ b/release/scripts/modules/bpy_extras/image_utils.py
@@ -95,6 +95,10 @@ def load_image(imagepath,
         if convert_callback:
             path = convert_callback(path)
 
+        # Ensure we're not relying on the 'CWD' to resolve the path.
+        if not os.path.isabs(path):
+            path = os.path.abspath(path)
+
         try:
             image = bpy.data.images.load(path, check_existing)
         except RuntimeError:




More information about the Bf-blender-cvs mailing list