[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13788] trunk/blender/source/blender/src/ fluidsim.c: Bugfix [#7847]: Fluid didn't work with ipo drivers

Daniel Genrich daniel.genrich at gmx.net
Wed Feb 20 21:15:01 CET 2008


Revision: 13788
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13788
Author:   genscher
Date:     2008-02-20 21:15:00 +0100 (Wed, 20 Feb 2008)

Log Message:
-----------
Bugfix [#7847]: Fluid didn't work with ipo drivers

Modified Paths:
--------------
    trunk/blender/source/blender/src/fluidsim.c

Modified: trunk/blender/source/blender/src/fluidsim.c
===================================================================
--- trunk/blender/source/blender/src/fluidsim.c	2008-02-20 20:07:37 UTC (rev 13787)
+++ trunk/blender/source/blender/src/fluidsim.c	2008-02-20 20:15:00 UTC (rev 13788)
@@ -350,6 +350,7 @@
 	char *cstr = NULL;
 	float *channel = NULL;
 	float aniFrlen = G.scene->r.framelen;
+	int current_frame = G.scene->r.cfra;
 	if((entries<1) || (entries>3)) {
 		printf("fluidsimInitChannel::Error - invalid no. of entries: %d\n",entries);
 		entries = 1;
@@ -368,6 +369,11 @@
 	for(j=0; j<entries; j++) {
 		if(icus[j]) { 
 			for(i=1; i<=size; i++) {
+				/* Bugfix to make python drivers working
+				// which uses Blender.get("curframe") 
+				*/
+				G.scene->r.cfra = floor(aniFrlen*((float)i));
+				
 				calc_icu(icus[j], aniFrlen*((float)i) );
 				channel[(i-1)*(entries+1) + j] = icus[j]->curval;
 			}
@@ -380,7 +386,7 @@
 	for(i=1; i<=size; i++) {
 		channel[(i-1)*(entries+1) + entries] = time[i];
 	}
-
+	G.scene->r.cfra = current_frame;
 	*setchannel = channel;
 }
 





More information about the Bf-blender-cvs mailing list