[Bf-blender-cvs] [3febcb98ed4] master: Image blendwrite: Fix handling of packedfiles.
Bastien Montagne
noreply at git.blender.org
Thu Aug 19 18:00:06 CEST 2021
Commit: 3febcb98ed4cbf65d7e6386fd3bc5ece2ad903bc
Author: Bastien Montagne
Date: Thu Aug 19 17:35:04 2021 +0200
Branches: master
https://developer.blender.org/rB3febcb98ed4cbf65d7e6386fd3bc5ece2ad903bc
Image blendwrite: Fix handling of packedfiles.
Packedfiles need some special attention when writing Image to disk.
Source: D12242, Jeroen Bakker (@jbakker), thanks.
===================================================================
M source/blender/blenkernel/intern/image.c
===================================================================
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;
+ }
}
}
More information about the Bf-blender-cvs
mailing list