diff options
author | Josef Raschen <JosefR> | 2021-10-16 00:13:31 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-10-16 00:20:45 +0300 |
commit | c383397d072f3fdc10857bd4b0e484c0de469e2f (patch) | |
tree | cd26f3f4d5b37299006cb7c27c9da9c0fbafd99a /source/blender/blenloader/intern | |
parent | e11b33fec33392640e74b9f180572fc0a504287e (diff) |
Fix versioning for sequencer color balance modifier.
Commit 213554f24a17 added slope/offset/power controls to the sequencer
color balance modifier, but colors in this mode were not initialized
with old files.
Initialize colors to default values.
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D12806
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index af61447e5ad..93c299a48aa 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -456,6 +456,22 @@ static bool do_versions_sequencer_color_tags(Sequence *seq, void *UNUSED(user_da return true; } +static bool do_versions_sequencer_color_balance_sop(Sequence *seq, void *UNUSED(user_data)) +{ + LISTBASE_FOREACH (SequenceModifierData *, smd, &seq->modifiers) { + if (smd->type == seqModifierType_ColorBalance) { + StripColorBalance *cb = &((ColorBalanceModifierData *)smd)->color_balance; + cb->method = SEQ_COLOR_BALANCE_METHOD_LIFTGAMMAGAIN; + for (int i = 0; i < 3; i++) { + copy_v3_fl(cb->slope, 1.0f); + copy_v3_fl(cb->offset, 1.0f); + copy_v3_fl(cb->power, 1.0f); + } + } + } + return true; +} + static bNodeLink *find_connected_link(bNodeTree *ntree, bNodeSocket *in_socket) { LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) { @@ -1709,6 +1725,13 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /* Set defaults for new color balance modifier parameters. */ + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + if (scene->ed != NULL) { + SEQ_for_each_callback(&scene->ed->seqbase, do_versions_sequencer_color_balance_sop, NULL); + } + } } if (!MAIN_VERSION_ATLEAST(bmain, 300, 33)) { |