diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-02-08 10:19:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-02-08 10:21:20 +0300 |
commit | dc2a01ca059d160f748064167200f275cede40a7 (patch) | |
tree | 40f2bb395bc671f9b7283bf4d11fa0919f583c16 /release/scripts/modules/bpy_extras | |
parent | f77110e789beda945d3725f19e6090ed20e2c613 (diff) |
Fix T47360: Image loading fails when accessible from the CWD
Diffstat (limited to 'release/scripts/modules/bpy_extras')
-rw-r--r-- | release/scripts/modules/bpy_extras/image_utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index f197596fec0..d078d63a417 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: |