diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-04 17:37:53 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-04 17:37:53 +0400 |
commit | 122cb86d1510e332966aba94cfa2c0f3a3c4f856 (patch) | |
tree | af3ea7e0cbabeb934a80285e57098b1206a885ef /source/blender/blenloader | |
parent | adea12cb01e4c4f18f345dfbbf49e9e622192e4e (diff) |
Sequencer: remove strip's color balance in favor of modifiers
Having two ways to control color balance now seems a bit overkill
and not clear.
Removed old Color Balance settings from the interface and logic,
added versioning code to convert this settings to modifier.
Unfortunately, since color balance was a pointer, it's not actually
possible to preserve compatibility of old files saved in new
blender and opened back in old blender.
Hopefully there's no regressions :)
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 49 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 3 |
2 files changed, 39 insertions, 13 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1021d2a794d..fe0c85e481e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5005,16 +5005,9 @@ static void direct_link_scene(FileData *fd, Scene *sce) else { seq->strip->proxy = NULL; } - if (seq->flag & SEQ_USE_COLOR_BALANCE) { - seq->strip->color_balance = newdataadr( - fd, seq->strip->color_balance); - } - else { - seq->strip->color_balance = NULL; - } - if (seq->strip->color_balance) { - // seq->strip->color_balance->gui = 0; // XXX - peter, is this relevant in 2.5? - } + + /* need to load color balance to it could be converted to modifier */ + seq->strip->color_balance = newdataadr(fd, seq->strip->color_balance); } direct_link_sequence_modifiers(fd, &seq->modifiers); @@ -7888,6 +7881,42 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ntreetype->foreach_nodetree(main, NULL, do_version_ntree_mask_264); } + if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 18)) { + Scene *scene; + + for (scene = main->scene.first; scene; scene = scene->id.next) { + if (scene->ed) { + Sequence *seq; + + SEQ_BEGIN (scene->ed, seq) + { + Strip *strip = seq->strip; + + if (strip && strip->color_balance) { + SequenceModifierData *smd; + ColorBalanceModifierData *cbmd; + + smd = BKE_sequence_modifier_new(seq, NULL, seqModifierType_ColorBalance); + cbmd = (ColorBalanceModifierData *) smd; + + cbmd->color_balance = *strip->color_balance; + + /* multiplication with color balance used is handled differently, + * so we need to move multiplication to modifier so files would be + * compatible + */ + cbmd->color_multiply = seq->mul; + seq->mul = 1.0f; + + MEM_freeN(strip->color_balance); + strip->color_balance = NULL; + } + } + SEQ_END + } + } + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index f8b3a548345..109a844352f 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2214,9 +2214,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase) if (seq->flag & SEQ_USE_PROXY && strip->proxy) { writestruct(wd, DATA, "StripProxy", 1, strip->proxy); } - if (seq->flag & SEQ_USE_COLOR_BALANCE && strip->color_balance) { - writestruct(wd, DATA, "StripColorBalance", 1, strip->color_balance); - } if (seq->type==SEQ_TYPE_IMAGE) writestruct(wd, DATA, "StripElem", MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem), strip->stripdata); else if (seq->type==SEQ_TYPE_MOVIE || seq->type==SEQ_TYPE_SOUND_RAM || seq->type == SEQ_TYPE_SOUND_HD) |