diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-02-09 02:07:53 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-02-09 02:07:53 +0300 |
commit | bc31b2c0f44ababb3120223b968dee872cec24f6 (patch) | |
tree | d3ef94674e967d96a259da67b04e823f4adf0d14 /source/blender/blenkernel | |
parent | f8455a8d405baa45e1b15f50b6bdf4759a83c46e (diff) |
Bugfix #21035: PLAYBACK: Consistent crash during playback
Circumvent using RNA path resolution code for finding the volume for sound baking, since this can lead to crashes in some cases.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 03fe1b8df7b..ff301fd8f26 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" @@ -282,7 +283,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 |