Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.48 KB | None | 0 0
  1. diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
  2. index f1ee606a06b..27353cfcb33 100644
  3. --- a/source/blender/editors/space_sequencer/sequencer_draw.c
  4. +++ b/source/blender/editors/space_sequencer/sequencer_draw.c
  5. @@ -38,12 +38,14 @@
  6.  #include "DNA_space_types.h"
  7.  #include "DNA_userdef_types.h"
  8.  #include "DNA_sound_types.h"
  9. +#include "DNA_anim_types.h"
  10.  
  11.  #include "BKE_context.h"
  12.  #include "BKE_global.h"
  13.  #include "BKE_sequencer.h"
  14.  #include "BKE_sound.h"
  15.  #include "BKE_scene.h"
  16. +#include "BKE_fcurve.h"
  17.  
  18.  #include "IMB_colormanagement.h"
  19.  #include "IMB_imbuf.h"
  20. @@ -251,8 +253,10 @@ static void drawseqwave(View2D *v2d,
  21.      float yscale = (y2 - y1) / 2.0f;
  22.      float samplestep;
  23.      float startsample, endsample;
  24. +    float volume = 1;
  25.      float value1, value2;
  26.      bSound *sound = seq->sound;
  27. +    FCurve *fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "volume", 0, NULL);
  28.  
  29.      SoundWaveform *waveform;
  30.  
  31. @@ -329,8 +333,12 @@ static void drawseqwave(View2D *v2d,
  32.          value2 = (1.0f - f) * value2 + f * waveform->data[p * 3 + 4];
  33.        }
  34.  
  35. -      value1 *= seq->volume;
  36. -      value2 *= seq->volume;
  37. +      if (fcu) {
  38. +        float evaltime = x1_offset + (i * stepsize);
  39. +        volume = evaluate_fcurve(fcu, evaltime);
  40. +      }
  41. +      value1 *= volume;
  42. +      value2 *= volume;
  43.  
  44.        if (value2 > 1 || value1 < -1) {
  45.          immAttr4f(col, 1.0f, 0.0f, 0.0f, 0.5f);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement