diff options
author | Nils Thuerey <nils@thuerey.de> | 2006-11-05 19:30:29 +0300 |
---|---|---|
committer | Nils Thuerey <nils@thuerey.de> | 2006-11-05 19:30:29 +0300 |
commit | 3bea663ffa27cab0a60b3ed1ac41d431ce55cecc (patch) | |
tree | c58fa1f791654b0b5e0d4057a0ec38ce541038c5 /source/blender/blenkernel | |
parent | 64b9cda68eb4cd25bc9ce37d710a603b2fc4c81d (diff) |
- bugfixes
#4742 exported normals are now correct
#4821 & 4956 for complex movements in/outflows can now also
use the animated mesh option
- new features
* isosurface subdivision: directly
creates a finer surface mesh from the simulation data.
this increases simulation time and harddisk usage, though, so
be careful - usually values of 2-4 should be enough.
* fluidsim particles: extended model for particle
simulation and generation. When isosurface subdivision is enabled,
the particles are now included in the surface generation,
giving a better impression of a single connected surface.
Note - the particles are only included in the final surface
mesh, so the preview surface shows none of the particle
effects.
* particle loading: different types of particles can now be selected for
display: drops, floats and tracers. This is a bit obsolete
due to the extensions mentioned above, but might still be useful.
Floats are just particles floating on the fluid surface, could
be used for e.g. foam.
* moving objects impact factor: this is another tweaking option,
as the handling of moving objects is still not conserving
mass. setting this to zero simply deletes the fluid, 1 is
the default, while larger values cause a stronger
impact. For tweaking the simulation: if fluid disappears, try
increasing this value, and if too much is appearing reduce it.
You can even use negative values for some strange results :)
- more code cleanup, e.g. removed config file writing in fluidsim.c,
added additional safety checks for particles & fluidsim domains (these
currently dont work together). I also removed the "build particles"
debug message in effects.c (seemed to be unnecessary?).
Some more info on the new features:
Here are two test animations showing the difference between
using the particle generation with isosurface subdivision.
This is how it would look with the old solver version:
http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid6_fl6manc4_1noparts.mpg
and this with the new one:
http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid6_fl6manc4_2wparts.mpg
Both simulations use a resolution of 64, however, the version with particles
takes significantly longer (almost twice as long).
The .blend file for a similar setup can be found here:
http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid6_testmanc4.blend
(Minor Tips for this file: dont enable subdivions of characters until rendering,
thus leave off for simulation, as it uses the rendering settings! For making
nice pictures switch on subdivion, and OSA.)
And here's a picture of old vs. new (for webpage or so):
http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid6_manc4compare.png
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 3ccdbe130a6..4dacfdc85d8 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -917,6 +917,7 @@ static DerivedMesh *getMeshDerivedMesh(Mesh *me, Object *ob, float (*vertCos)[3] if((ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (ob->fluidsimSettings->type & OB_FLUIDSIM_DOMAIN)&& (ob->fluidsimSettings->meshSurface) && + (1) && (!give_parteff(ob)) && // doesnt work together with particle systems! (me->totvert == ((Mesh *)(ob->fluidsimSettings->meshSurface))->totvert) ) { // dont recompute for fluidsim mesh, use from readBobjgz // TODO? check for modifiers!? @@ -2816,7 +2817,8 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], * domain objects */ if((G.obedit!=ob) && !needMapping) { - if (ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) { + if((ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && + (1) && (!give_parteff(ob)) ) { // doesnt work together with particle systems! if(ob->fluidsimSettings->type & OB_FLUIDSIM_DOMAIN) { loadFluidsimMesh(ob,useRenderParams); fluidsimMeshUsed = 1; diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index a22bdad628e..08ea3b9abe1 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -1685,11 +1685,11 @@ void build_particle_system(Object *ob) if(paf->keys) MEM_freeN(paf->keys); /* free as early as possible, for returns */ paf->keys= NULL; - printf("build particles\n"); + //printf("build particles\n"); - /* fluid sim particle import handling, actual loading */ + /* fluid sim particle import handling, actual loading of particles from file */ #ifndef DISABLE_ELBEEM - if( (1) && (ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && + if( (1) && (ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && // broken, disabled for now! (ob->fluidsimSettings) && (ob->fluidsimSettings->type == OB_FLUIDSIM_PARTICLE)) { char *suffix = "fluidsurface_particles_#"; @@ -1702,7 +1702,7 @@ void build_particle_system(Object *ob) float vel[3]; if(ob==G.obedit) { // off... - paf->totpart = 1; + paf->totpart = 0; // 1 or 0? return; } @@ -1715,8 +1715,10 @@ void build_particle_system(Object *ob) gzf = gzopen(filename, "rb"); if (!gzf) { snprintf(debugStrBuffer,256,"readFsPartData::error - Unable to open file for reading '%s' \n", filename); +fprintf(stderr,"readFsPartData::error - Unable to open file for reading '%s' \n", filename); // DEBUG! //elbeemDebugOut(debugStrBuffer); - paf->totpart = 1; + //fprintf(stderr,"NO PARTOP!\n"); + paf->totpart = 0; return; } @@ -1753,7 +1755,7 @@ void build_particle_system(Object *ob) // convert range of 1.0-10.0 to shorts 1000-10000) shsize = (short)(convertSize*1000.0); pa->rt = shsize; - //if(a<200) fprintf(stderr,"SREAD %f %d %d \n",convertSize,shsize,pa->rt); + //if(a<200) fprintf(stderr,"SREAD, %d/%d: %f %d %d \n",a,totpart, convertSize,shsize,pa->rt); for(j=0; j<3; j++) { float wrf; |