diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-08-19 19:41:56 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-08-19 19:41:56 +0400 |
commit | 995a19a983b2c44ec9afec049395d7c1b4320137 (patch) | |
tree | 8333563ae983641434179839755aab67ecdc2aad /source/blender/blenloader/intern/writefile.c | |
parent | 994d75b6ae78fee99afd949292e48c4f32292995 (diff) |
Sequencer: per-sequence modifier stack for color grading
This implements basic color grading modifiers in sequencer, supporting
color balance, RGB curves and HUE corrections.
Implementation is close to object modifiers, some details are there:
http://wiki.blender.org/index.php/User:Nazg-gul/SequencerModifiers
Modifiers supports multi-threaded calculation, masks and instant
parameter changes.
Also added cache for pre-processed image buffers for current frame,
so changing sequence properties does not require rendering of original
sequence (like rendering scene, loading file from disk and so)
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 2a68af688ed..4ada0c54a93 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -646,15 +646,21 @@ static void write_animdata(WriteData *wd, AnimData *adt) write_nladata(wd, &adt->nla_tracks); } -static void write_curvemapping(WriteData *wd, CurveMapping *cumap) +static void write_curvemapping_curves(WriteData *wd, CurveMapping *cumap) { int a; - - writestruct(wd, DATA, "CurveMapping", 1, cumap); - for (a=0; a<CM_TOT; a++) + + for (a = 0; a < CM_TOT; a++) writestruct(wd, DATA, "CurveMapPoint", cumap->cm[a].totpoint, cumap->cm[a].curve); } +static void write_curvemapping(WriteData *wd, CurveMapping *cumap) +{ + writestruct(wd, DATA, "CurveMapping", 1, cumap); + + write_curvemapping_curves(wd, cumap); +} + static void write_node_socket(WriteData *wd, bNodeSocket *sock) { bNodeSocketType *stype= ntreeGetSocketType(sock->type); @@ -2086,6 +2092,32 @@ static void write_lamps(WriteData *wd, ListBase *idbase) } } +static void write_sequence_modifiers(WriteData *wd, ListBase *modbase) +{ + SequenceModifierData *smd; + + for (smd = modbase->first; smd; smd = smd->next) { + SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type); + + if (smti) { + writestruct(wd, DATA, smti->struct_name, 1, smd); + + if (smd->type == seqModifierType_Curves) { + CurvesModifierData *cmd = (CurvesModifierData *) smd; + + write_curvemapping(wd, &cmd->curve_mapping); + } + else if (smd->type == seqModifierType_HueCorrect) { + HueCorrectModifierData *hcmd = (HueCorrectModifierData *) smd; + + write_curvemapping(wd, &hcmd->curve_mapping); + } + } + else { + writestruct(wd, DATA, "SequenceModifierData", 1, smd); + } + } +} static void write_scenes(WriteData *wd, ListBase *scebase) { @@ -2192,6 +2224,8 @@ static void write_scenes(WriteData *wd, ListBase *scebase) strip->done = TRUE; } + + write_sequence_modifiers(wd, &seq->modifiers); } SEQ_END |