Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/image.py
| Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | def invoke(self, context, event): | ||||
| except AttributeError: | except AttributeError: | ||||
| self.report({'ERROR'}, "Context incorrect, image not found") | self.report({'ERROR'}, "Context incorrect, image not found") | ||||
| return {'CANCELLED'} | return {'CANCELLED'} | ||||
| if image.packed_file: | if image.packed_file: | ||||
| self.report({'ERROR'}, "Image is packed, unpack before editing") | self.report({'ERROR'}, "Image is packed, unpack before editing") | ||||
| return {'CANCELLED'} | return {'CANCELLED'} | ||||
| filepath = bpy.path.abspath(image.filepath, library=image.library) | if context.space_data.type == 'IMAGE_EDITOR': | ||||
| filepath = image.path_for_user(context.space_data.image_user) | |||||
| else: | |||||
| filepath = image.filepath | |||||
| filepath = bpy.path.abspath(filepath, library=image.library) | |||||
| self.filepath = os.path.normpath(filepath) | self.filepath = os.path.normpath(filepath) | ||||
| self.execute(context) | self.execute(context) | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| class SaveDirty(Operator): | class SaveDirty(Operator): | ||||
| ▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines | |||||