diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index 1981737aea10bb649524059f4678c77c1b7ec487..269de1bfd5de383016e1779c47793489c7d77dc1 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 dd8c3a054da2ecdf6c9ea431688d7f341160530e..0a4e23a5e256c052985e45a9a510f5f40becea23 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