diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-03-05 00:45:22 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-17 21:03:26 +0300 |
commit | 3022dd2b27fdfd8aca369bfb0e390965de448b7a (patch) | |
tree | eea6afe132dd000bcf57cc5a35fc3261588d73ec /release | |
parent | 60a4342557f19dab8e17825800bca4fbb3cccb85 (diff) |
Images: changes to avoid losing new images that have not been saved
The basic idea is that such new images will be packed into the .blend file
when saving all modified images from the quit dialog. To make this workflow
nicer a number of changes were made to how this type of packed image is
handled.
* "Save Modified Images" now packs generated images into the .blend file.
* "Save As" for packed images now automatically unpacks the image, so that
it's easy to save automatically packed images. "Save Copy" keeps it packed.
* "Save" for packed images now re-saves the image into the .blend file, so
that it's effectively the equivalent of "Save" for non-packed images.
* Empty image filepaths are no longer remapped when saving the .blend file.
Previously it would become e.g. "//../../" which makes no sense for generated
images with no filepath yet.
* Hide unpack button and filepath for such packed images with no filepath.
Unpacking does not work in a predictable way without a filepath, better
to just "Save As".
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 5ea3545dbc2..6a658418059 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -237,13 +237,14 @@ class IMAGE_MT_image(Menu): layout.menu("IMAGE_MT_image_invert") - if not show_render: - layout.separator() - if ima.packed_file: - layout.operator("image.pack", text="Repack") + if ima and not show_render: + if ima.packed_file: + if len(ima.filepath): + layout.separator() layout.operator("image.unpack", text="Unpack") - else: - layout.operator("image.pack", text="Pack") + else: + layout.separator() + layout.operator("image.pack", text="Pack") class IMAGE_MT_image_invert(Menu): |