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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/startup/bl_operators/image.py')
-rw-r--r--release/scripts/startup/bl_operators/image.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py
index 2b190e1aee1..d0778ddafb2 100644
--- a/release/scripts/startup/bl_operators/image.py
+++ b/release/scripts/startup/bl_operators/image.py
@@ -69,8 +69,6 @@ class EditExternally(Operator):
self.report({'ERROR'}, "Image path not set")
return {'CANCELLED'}
- filepath = os.path.normpath(bpy.path.abspath(filepath))
-
if not os.path.exists(filepath):
self.report({'ERROR'},
"Image path %r not found, image may be packed or "
@@ -93,15 +91,16 @@ class EditExternally(Operator):
return {'FINISHED'}
def invoke(self, context, event):
+ import os
try:
- filepath = context.space_data.image.filepath
- except:
- import traceback
- traceback.print_exc()
- self.report({'ERROR'}, "Image not found on disk")
+ image = context.space_data.image
+ except AttributeError:
+ self.report({'ERROR'}, "Context incorrect, image not found")
return {'CANCELLED'}
- self.filepath = filepath
+ filepath = bpy.path.abspath(image.filepath, library=image.library)
+
+ self.filepath = os.path.normpath(filepath)
self.execute(context)
return {'FINISHED'}