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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-07-22 22:51:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-22 22:51:17 +0400
commit2570e9660f21862d00e1a7e0d78b33f741c21141 (patch)
treef5fca04cac99ec6df00458c8bb81cc8fedc4b413 /io_import_images_as_planes.py
parent39168323d826e7dfa148cdbb1ba64751a11d3d90 (diff)
fix error when finding relative paths on windows.
Diffstat (limited to 'io_import_images_as_planes.py')
-rw-r--r--io_import_images_as_planes.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py
index f1bd5448..1981737a 100644
--- a/io_import_images_as_planes.py
+++ b/io_import_images_as_planes.py
@@ -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