diff options
author | Richard Antalik <richardantalik@gmail.com> | 2019-06-19 20:36:45 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2019-06-19 20:39:43 +0300 |
commit | f47c9ad96fdd84d71d3d43a43621b358cf1273de (patch) | |
tree | b25ee9147597d9f3b91865edecfd6602b7b3ef12 | |
parent | ccf06c1ff218971d6844b7a8e6ad021cdc90ea3d (diff) |
VSE: Draw pre-animated (volume) sound strip waveforms.
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index f1ee606a06b..e53a3cb02a7 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -38,12 +38,14 @@ #include "DNA_space_types.h" #include "DNA_userdef_types.h" #include "DNA_sound_types.h" +#include "DNA_anim_types.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_sequencer.h" #include "BKE_sound.h" #include "BKE_scene.h" +#include "BKE_fcurve.h" #include "IMB_colormanagement.h" #include "IMB_imbuf.h" @@ -251,8 +253,10 @@ static void drawseqwave(View2D *v2d, float yscale = (y2 - y1) / 2.0f; float samplestep; float startsample, endsample; + float volume = seq->volume; float value1, value2; bSound *sound = seq->sound; + FCurve *fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "volume", 0, NULL); SoundWaveform *waveform; @@ -329,8 +333,12 @@ static void drawseqwave(View2D *v2d, value2 = (1.0f - f) * value2 + f * waveform->data[p * 3 + 4]; } - value1 *= seq->volume; - value2 *= seq->volume; + if (fcu) { + float evaltime = x1_offset + (i * stepsize); + volume = evaluate_fcurve(fcu, evaltime); + } + value1 *= volume; + value2 *= volume; if (value2 > 1 || value1 < -1) { immAttr4f(col, 1.0f, 0.0f, 0.0f, 0.5f); |