From 64bcdd65bf0727c5e39ac2b3f32bf897bfbf07a1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 20 Feb 2016 14:52:36 +0100 Subject: Images: support packing edited images as OpenEXR or PNG. This way float and multilayer images can now be packed without data loss. This removes the as_png option and always uses the appropriate file format depending on the image contents. --- release/scripts/startup/bl_operators/image.py | 2 +- release/scripts/startup/bl_ui/space_image.py | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py index a3de2811750..d07546d1773 100644 --- a/release/scripts/startup/bl_operators/image.py +++ b/release/scripts/startup/bl_operators/image.py @@ -132,7 +132,7 @@ class SaveDirty(Operator): " can't be re-packed" % (image.name, image.library.filepath)) else: - image.pack(as_png=True) + image.pack() else: filepath = bpy.path.abspath(image.filepath, library=image.library) diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index a233295c2c5..7d3b76683e9 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -228,18 +228,12 @@ class IMAGE_MT_image(Menu): layout.menu("IMAGE_MT_image_invert") if not show_render: - if not ima.packed_file: - layout.separator() + layout.separator() + if ima.packed_file: + layout.operator("image.pack", text="Repack") + else: layout.operator("image.pack", text="Pack") - # Only for dirty && specific image types, perhaps - # this could be done in operator poll too. - if ima.is_dirty: - if ima.source in {'FILE', 'GENERATED'} and ima.type != 'OPEN_EXR_MULTILAYER': - if ima.packed_file: - layout.separator() - layout.operator("image.pack", text="Pack As PNG").as_png = True - class IMAGE_MT_image_invert(Menu): bl_label = "Invert" -- cgit v1.2.3