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:
authorBastien Montagne <mont29>2020-12-14 13:28:08 +0300
committerBastien Montagne <bastien@blender.org>2020-12-14 13:37:01 +0300
commitf5a019ed43ab07a7d265d81e8ce89d15aaff00ef (patch)
tree1f904f8a809d8a22f3fc4689937ac83171e0c427 /source/blender/blenkernel/intern/image.c
parent8e1b63d4bd5bd5bc26baf62e9c0771e7b563aa59 (diff)
LibOverride: Do not store some heavy data from override IDs.
This commit removes geometry from meshes and shapekeys, and embedded files, from liboverride IDs. This data is never overrideable, there is no reason to store extra useless copies of it in production files. See T78944. Note that we may add more data to be skipped on write for liboverrides in the future, but this commit should address all the most important cases already. Reviewed By: brecht Differential Revision: https://developer.blender.org/D9810
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index cd2ed32cd4f..f72cce8ba2e 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -225,14 +225,21 @@ static void image_foreach_cache(ID *id,
static void image_blend_write(BlendWriter *writer, ID *id, const void *id_address)
{
Image *ima = (Image *)id;
- if (ima->id.us > 0 || BLO_write_is_undo(writer)) {
+ const bool is_undo = BLO_write_is_undo(writer);
+ if (ima->id.us > 0 || is_undo) {
ImagePackedFile *imapf;
- /* Some trickery to keep forward compatibility of packed images. */
BLI_assert(ima->packedfile == NULL);
- if (ima->packedfiles.first != NULL) {
- imapf = ima->packedfiles.first;
- ima->packedfile = imapf->packedfile;
+ /* 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;
+ }
}
/* write LibData */