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/sound.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/sound.c')
-rw-r--r--source/blender/blenkernel/intern/sound.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 8b66b1fc628..5bcc1a9553a 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -135,13 +135,19 @@ static void sound_foreach_cache(ID *id,
static void sound_blend_write(BlendWriter *writer, ID *id, const void *id_address)
{
bSound *sound = (bSound *)id;
- if (sound->id.us > 0 || BLO_write_is_undo(writer)) {
+ const bool is_undo = BLO_write_is_undo(writer);
+ if (sound->id.us > 0 || is_undo) {
/* Clean up, important in undo case to reduce false detection of changed datablocks. */
sound->tags = 0;
sound->handle = NULL;
sound->playback_handle = NULL;
sound->spinlock = NULL;
+ /* Do not store packed files in case this is a library override ID. */
+ if (ID_IS_OVERRIDE_LIBRARY(sound) && !is_undo) {
+ sound->packedfile = NULL;
+ }
+
/* write LibData */
BLO_write_id_struct(writer, bSound, id_address, &sound->id);
BKE_id_blend_write(writer, &sound->id);