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:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-02-20 23:15:00 +0300
committerDaniel Genrich <daniel.genrich@gmx.net>2008-02-20 23:15:00 +0300
commit59fc05b1b9d9421e72c6146e246d03b0d903272b (patch)
treeca4ef62f3a5979b30e494ecf3515b985181cfc86 /source/blender/src/fluidsim.c
parent2e299df561c22fec827282d7de8bd5b779ece0db (diff)
Bugfix [#7847]: Fluid didn't work with ipo drivers
Diffstat (limited to 'source/blender/src/fluidsim.c')
-rw-r--r--source/blender/src/fluidsim.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c
index a6620cef927..ac90d3ed119 100644
--- a/source/blender/src/fluidsim.c
+++ b/source/blender/src/fluidsim.c
@@ -350,6 +350,7 @@ static void fluidsimInitChannel(float **setchannel, int size, float *time,
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 @@ static void fluidsimInitChannel(float **setchannel, int size, float *time,
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 @@ static void fluidsimInitChannel(float **setchannel, int size, float *time,
for(i=1; i<=size; i++) {
channel[(i-1)*(entries+1) + entries] = time[i];
}
-
+ G.scene->r.cfra = current_frame;
*setchannel = channel;
}