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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-09-04 17:37:53 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-09-04 17:37:53 +0400
commit122cb86d1510e332966aba94cfa2c0f3a3c4f856 (patch)
treeaf3ea7e0cbabeb934a80285e57098b1206a885ef /source/blender/blenloader/intern/readfile.c
parentadea12cb01e4c4f18f345dfbbf49e9e622192e4e (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/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c49
1 files changed, 39 insertions, 10 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! */