Fix T41086: VSE separate images increases file size abnormally.

We were copying everything from the old sequence into each new ones... including the stripdata,
which for image sequences is an array with one item per image!

So bug was an exponential one, separating strips of a few tens of images was insensible, while
separating a strip of 1000 images would add above 250MB to file size (and RAM usage too)!
This commit is contained in:
Bastien Montagne 2014-07-21 22:55:06 +02:00
parent 86059f03eb
commit 2e436173aa
Notes: blender-bot 2023-02-14 10:20:06 +01:00
Referenced by issue #41139, Cycles Hair BSDF roughness problem
Referenced by issue #41086, VSE separate images increases file size abnormally
1 changed files with 5 additions and 2 deletions

View File

@ -1919,9 +1919,12 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
strip_new = seq_new->strip;
strip_new->us = 1;
/* new stripdata */
se_new = strip_new->stripdata;
/* new stripdata (only one element now!) */
/* Note this assume all elements (images) have the same dimension, since we only copy the name here. */
se_new = MEM_reallocN(strip_new->stripdata, sizeof(*se_new));
BLI_strncpy(se_new->name, se->name, sizeof(se_new->name));
strip_new->stripdata = se_new;
BKE_sequence_calc(scene, seq_new);
if (step > 1) {