[Bf-blender-cvs] [f47c9ad96fd] master: VSE: Draw pre-animated (volume) sound strip waveforms.
Richard Antalik
noreply at git.blender.org
Wed Jun 19 19:53:09 CEST 2019
Commit: f47c9ad96fdd84d71d3d43a43621b358cf1273de
Author: Richard Antalik
Date: Wed Jun 19 10:36:45 2019 -0700
Branches: master
https://developer.blender.org/rBf47c9ad96fdd84d71d3d43a43621b358cf1273de
VSE: Draw pre-animated (volume) sound strip waveforms.
===================================================================
M source/blender/editors/space_sequencer/sequencer_draw.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list