Skip to content
Snippets Groups Projects
Commit 2570e966 authored by Campbell Barton's avatar Campbell Barton
Browse files

fix error when finding relative paths on windows.

parent 39168323
No related branches found
No related tags found
No related merge requests found
......@@ -453,7 +453,15 @@ class IMPORT_OT_image_to_plane(Operator, AddObjectHelper):
image.use_fields = self.use_fields
if self.relative:
image.filepath = bpy.path.relpath(image.filepath)
# can't always find the relative path
# (between drive letters on windows)
try:
filepath_rel = bpy.path.relpath(image.filepath)
except ValueError:
filepath_rel = None
if filepath_rel is not None:
image.filepath = filepath_rel
def set_texture_options(self, context, texture):
texture.image.use_alpha = self.use_transparency
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment