diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-08-18 19:16:51 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-08-18 19:16:51 +0400 |
commit | 0cd7b6c60d1d1f60e70090e06ac985a402bbef36 (patch) | |
tree | 4e2286419775dd5fb2230d575d8bf5d53196e72e /io_import_images_as_planes.py | |
parent | 91e25c8fe96ffcbd14076e09c0659cb753bcd6c3 (diff) |
More "relpath" try/except protection...
Note: import gimp image also would need it, but it would anyway need a good cleanup (handling of paths is ugly), so did not bothered with it for now.
Diffstat (limited to 'io_import_images_as_planes.py')
-rw-r--r-- | io_import_images_as_planes.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index 1981737a..269de1bf 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -453,15 +453,10 @@ class IMPORT_OT_image_to_plane(Operator, AddObjectHelper): image.use_fields = self.use_fields if self.relative: - # can't always find the relative path - # (between drive letters on windows) - try: - filepath_rel = bpy.path.relpath(image.filepath) + try: # can't always find the relative path (between drive letters on windows) + image.filepath = bpy.path.relpath(image.filepath) except ValueError: - filepath_rel = None - - if filepath_rel is not None: - image.filepath = filepath_rel + pass def set_texture_options(self, context, texture): texture.image.use_alpha = self.use_transparency |