diff options
-rw-r--r-- | io_import_images_as_planes.py | 11 | ||||
-rw-r--r-- | texture_paint_layer_manager.py | 8 |
2 files changed, 9 insertions, 10 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 diff --git a/texture_paint_layer_manager.py b/texture_paint_layer_manager.py index dd8c3a05..0a4e23a5 100644 --- a/texture_paint_layer_manager.py +++ b/texture_paint_layer_manager.py @@ -559,12 +559,16 @@ def save_painted(ts): name = name +'.tga' bpy.context.scene.render.image_settings.color_mode = 'RGBA' - fp =bpy.path.abspath('//textures' + sep + name) + fp = bpy.path.abspath('//textures' + sep + name) try: i.save_render(fp) i.source = 'FILE' if bpy.context.user_preferences.filepaths.use_relative_paths: - i.filepath = bpy.path.relpath(fp) + # can't always find the relative path (between drive letters on windows) + try: + i.filepath = bpy.path.relpath(fp) + except ValueError: + i.filepath = fp else: i.filepath = fp i.name = name |