Skip to content

Commit

Permalink
Fix: Error when trying to save as image to different drive
Browse files Browse the repository at this point in the history
  • Loading branch information
ucupumar committed Jun 1, 2024
1 parent 6e367ba commit e17b7dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions image_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,8 +1048,9 @@ def execute(self, context):
if not self.copy:
image.filepath = self.filepath

if self.relative:
image.filepath = bpy.path.relpath(image.filepath)
if self.relative and bpy.data.filepath != '':
try: image.filepath = bpy.path.relpath(image.filepath)
except Exception as e: print(e)
else: image.filepath = bpy.path.abspath(image.filepath)

image.source = 'FILE'
Expand Down

0 comments on commit e17b7dc

Please sign in to comment.