diff options
author | Bastien Montagne <bastien@blender.org> | 2021-08-19 18:35:04 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-08-19 19:00:00 +0300 |
commit | 3febcb98ed4cbf65d7e6386fd3bc5ece2ad903bc (patch) | |
tree | cd42a1194af52c45dd451dca7e00f9f1f7a5c877 /source/blender/blenkernel/intern/image.c | |
parent | 0896457c59d722e809188517c042b57d0ea399d3 (diff) |
Image blendwrite: Fix handling of packedfiles.
Packedfiles need some special attention when writing Image to disk.
Source: D12242, Jeroen Bakker (@jbakker), thanks.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f37073ff135..5701449a9e5 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -246,15 +246,17 @@ static void image_blend_write(BlendWriter *writer, ID *id, const void *id_addres ImagePackedFile *imapf; BLI_assert(ima->packedfile == NULL); - /* Do not store packed files in case this is a library override ID. */ - if (ID_IS_OVERRIDE_LIBRARY(ima) && !is_undo) { - BLI_listbase_clear(&ima->packedfiles); - } - else { - /* Some trickery to keep forward compatibility of packed images. */ - if (ima->packedfiles.first != NULL) { - imapf = ima->packedfiles.first; - ima->packedfile = imapf->packedfile; + if (!is_undo) { + /* Do not store packed files in case this is a library override ID. */ + if (ID_IS_OVERRIDE_LIBRARY(ima)) { + BLI_listbase_clear(&ima->packedfiles); + } + else { + /* Some trickery to keep forward compatibility of packed images. */ + if (ima->packedfiles.first != NULL) { + imapf = ima->packedfiles.first; + ima->packedfile = imapf->packedfile; + } } } |