diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-07-05 23:18:36 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-07-05 23:18:41 +0300 |
commit | aea44561017ccfba58bd97741dde1508aa826a44 (patch) | |
tree | aad7f56e23039842c1d71a03eb2081b78a723d71 /source/blender/blenloader | |
parent | 31f8ca503495e5900a4ec5f7361b3c20bf365f37 (diff) |
Better fix for sequencer crash when text strip doesn't have effect data.
This situation happens when a file with a text effect sequencer strip is
loaded in Blender < 2.76 and saved. This destroys the effect data, causing
a crash in Blender ≥ 2.76.
d2f748a222ad19f prevented the crash when opening such a file, but accessing
the strip still caused a crash. This commit fixes that by actually
initialising the invalid strip. Of course this still causes data loss, but
that already happened by opening & overwriting the file in Blender < 2.76.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 87ccfedcff3..94d335870ca 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1236,12 +1236,19 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) SEQ_BEGIN (scene->ed, seq) { - if (seq->type == SEQ_TYPE_TEXT) { - TextVars *data = seq->effectdata; - if (data != NULL && data->color[3] == 0.0f) { - copy_v4_fl(data->color, 1.0f); - data->shadow_color[3] = 1.0f; - } + if (seq->type != SEQ_TYPE_TEXT) { + continue; + } + + if (seq->effectdata == NULL) { + struct SeqEffectHandle effect_handle = BKE_sequence_get_effect(seq); + effect_handle.init(seq); + } + + TextVars *data = seq->effectdata; + if (data->color[3] == 0.0f) { + copy_v4_fl(data->color, 1.0f); + data->shadow_color[3] = 1.0f; } } SEQ_END |