Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-15 04:32:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-15 04:32:12 +0400
commit4006f8c83baf402c64c4032b05aaa257a76f621a (patch)
tree41e98f0c10b21109fb5eebb7d5c41bbc7e9c2930 /release
parent196d30e0046088820e240642e318e051e2e69fbc (diff)
fix [#36455] importing obj data after saving doesn't work
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy_extras/image_utils.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py
index 551689c5a75..ff6d23badb6 100644
--- a/release/scripts/modules/bpy_extras/image_utils.py
+++ b/release/scripts/modules/bpy_extras/image_utils.py
@@ -105,7 +105,15 @@ def load_image(imagepath,
if relpath is not None:
# make relative
from bpy.path import relpath as relpath_fn
- image.filepath_raw = relpath_fn(path, start=relpath)
+ # can't always find the relative path
+ # (between drive letters on windows)
+ try:
+ filepath_rel = relpath_fn(path, start=relpath)
+ except ValueError:
+ filepath_rel = None
+
+ if filepath_rel is not None:
+ image.filepath_raw = filepath_rel
return image