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:
authorCampbell Barton <ideasman42@gmail.com>2012-05-04 21:39:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-04 21:39:37 +0400
commite96187250e6b570432ddb88b761171c2afc88c44 (patch)
tree0a36fff4f259b4490e8a2a99467dc3840eb1900b
parentad93736bd461d4e78fad3816dc4d6789ceb20b10 (diff)
fix [#31136] Save All Edited only works for Saved external image, not New or Packed image (bpy.ops.image.save_dirty)
-rw-r--r--release/scripts/startup/bl_operators/image.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py
index 1b7d5e3a40d..6af6488e86b 100644
--- a/release/scripts/startup/bl_operators/image.py
+++ b/release/scripts/startup/bl_operators/image.py
@@ -118,16 +118,24 @@ class SaveDirty(Operator):
unique_paths = set()
for image in bpy.data.images:
if image.is_dirty:
- filepath = bpy.path.abspath(image.filepath)
- if "\\" not in filepath and "/" not in filepath:
- self.report({'WARNING'}, "Invalid path: " + filepath)
- elif filepath in unique_paths:
- self.report({'WARNING'},
- "Path used by more then one image: %r" %
- filepath)
+ if image.packed_file:
+ if image.library:
+ self.report({'WARNING'},
+ "Packed library image: %r from library %r can't be re-packed" %
+ (image.name, image.library.filepath))
+ else:
+ image.pack(as_png=True)
else:
- unique_paths.add(filepath)
- image.save()
+ filepath = bpy.path.abspath(image.filepath, library=image.library)
+ if "\\" not in filepath and "/" not in filepath:
+ self.report({'WARNING'}, "Invalid path: " + filepath)
+ elif filepath in unique_paths:
+ self.report({'WARNING'},
+ "Path used by more then one image: %r" %
+ filepath)
+ else:
+ unique_paths.add(filepath)
+ image.save()
return {'FINISHED'}