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:
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r--source/blender/blenkernel/intern/sound.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 03fe1b8df7b..35cedbd2d53 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -11,6 +11,7 @@
#include "BLI_blenlib.h"
+#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "DNA_sound_types.h"
@@ -28,6 +29,7 @@
#include "BKE_library.h"
#include "BKE_packedFile.h"
#include "BKE_fcurve.h"
+#include "BKE_animsys.h"
#include "RNA_access.h"
@@ -282,7 +284,15 @@ void sound_free(struct bSound* sound)
static float sound_get_volume(Scene* scene, Sequence* sequence, float time)
{
- struct FCurve* fcu = id_data_find_fcurve(&scene->id, sequence, &RNA_Sequence, "volume", 0);
+ AnimData *adt= BKE_animdata_from_id(&scene->id);
+ FCurve *fcu = NULL;
+ char buf[64];
+
+ /* NOTE: this manually constructed path needs to be used here to avoid problems with RNA crashes */
+ sprintf(buf, "sequence_editor.sequences_all[\"%s\"].volume", sequence->name+2);
+ if (adt && adt->action && adt->action->curves.first)
+ fcu= list_find_fcurve(&adt->action->curves, buf, 0);
+
if(fcu)
return evaluate_fcurve(fcu, time * FPS);
else