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:
authorNils Thuerey <nils@thuerey.de>2005-12-18 18:55:11 +0300
committerNils Thuerey <nils@thuerey.de>2005-12-18 18:55:11 +0300
commitf98851f32c61d6b1cd83e6229396d7244d37c880 (patch)
tree90476c276d4246f28cc5590fc4d1710467d9a563
parent6f158b6f9bf5d0e19682a57f484f05a669ff04f3 (diff)
- another small fix thats prevent a cryptic error message
if the fluid is baked without proper frame start & end settings
-rw-r--r--source/blender/src/fluidsim.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c
index cb6519253b7..69f32767c66 100644
--- a/source/blender/src/fluidsim.c
+++ b/source/blender/src/fluidsim.c
@@ -276,6 +276,7 @@ void fluidsimBake(struct Object *ob)
char targetFile[FILE_MAXDIR+FILE_MAXFILE]; // temp. store filename from targetDir for access
int outStringsChanged = 0; // modified? copy back before baking
int haveSomeFluid = 0; // check if any fluid objects are set
+ int noFrames = G.scene->r.efra - G.scene->r.sfra;
const char *strEnvName = "BLENDER_ELBEEMDEBUG"; // from blendercall.cpp
@@ -286,6 +287,11 @@ void fluidsimBake(struct Object *ob)
elbeemDebugOut(debugStrBuffer);
}
+ if(noFrames<=0) {
+ pupmenu("Fluidsim Bake Error%t|No frames to export - check your animation range settings. Aborted%x0");
+ return;
+ }
+
/* check if there's another domain... */
for(obit= G.main->object.first; obit; obit= obit->id.next) {
if((obit->fluidsimFlag & OB_FLUIDSIM_ENABLE)&&(obit->type==OB_MESH)) {
@@ -420,7 +426,6 @@ void fluidsimBake(struct Object *ob)
/* output simulation settings */
{
- int noFrames = G.scene->r.efra - G.scene->r.sfra;
double calcViscosity = 0.0;
double aniFrameTime = (fssDomain->animEnd - fssDomain->animStart)/(double)noFrames;
char *simString = "\n"
@@ -550,7 +555,6 @@ void fluidsimBake(struct Object *ob)
" castShadows= 1; \n"
" } \n\n" ;
- int noFrames = (G.scene->r.efra - G.scene->r.sfra) +1; // FIXME - check no. of frames...
struct Object *cam = G.scene->camera;
float eyex=2.0, eyey=2.0, eyez=2.0;
int resx = 200, resy=200;
@@ -575,7 +579,7 @@ void fluidsimBake(struct Object *ob)
}
fprintf(fileCfg, rayString,
- noFrames, targetFile, resx,resy,
+ (noFrames+1), targetFile, resx,resy,
eyex, eyey, eyez ,
lookatx, lookaty, lookatz,
fov
@@ -706,7 +710,7 @@ void fluidsimBake(struct Object *ob)
int done = 0;
unsigned short event=0;
short val;
- float noFramesf = G.scene->r.efra - G.scene->r.sfra +1;
+ float noFramesf = (float)noFrames;
float percentdone = 0.0;
int lastRedraw = -1;