[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26725] trunk/blender/source/blender/ blenkernel/intern/sound.c: Bugfix #21035: PLAYBACK: Consistent crash during playback

Joshua Leung aligorith at gmail.com
Tue Feb 9 00:07:54 CET 2010


Revision: 26725
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26725
Author:   aligorith
Date:     2010-02-09 00:07:53 +0100 (Tue, 09 Feb 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/sound.c

Modified: trunk/blender/source/blender/blenkernel/intern/sound.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sound.c	2010-02-08 22:44:55 UTC (rev 26724)
+++ trunk/blender/source/blender/blenkernel/intern/sound.c	2010-02-08 23:07:53 UTC (rev 26725)
@@ -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 @@
 
 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





More information about the Bf-blender-cvs mailing list