fix [#36455] importing obj data after saving doesn't work

This commit is contained in:
Campbell Barton 2013-08-15 00:32:12 +00:00
parent 196d30e004
commit 4006f8c83b

@ -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