[Soc-2016-dev] Weekly Report #04, Mantaflow Liquids

Sebastián Barschkis sebbas at sebbas.org
Sun Jun 19 10:34:53 CEST 2016


Hello everyone,

my report for the week is online.

https://wiki.blender.org/index.php/User:Sebbas/GSoC_2016/Reports/Week_4

= Week 4 =

=== What's been done ===

* I finished the cache reading mechanism. The bobj.gz that Mantaflow creates are
now loaded, a mesh is constructed and then shown in the viewport. The whole
process works similarly to the smoke pointcache, where the .bphys are read on
the fly.

* I tried out various approaches for the reading mechanism but in the end 
ettled with the following (which in my view is quite neat):

** The fluid wrapper object is responsible for reading the .bobj.gz data. For
every frame, it loads its own fields with data from those files.

** The pointcache triggers the fluid objects functions. It basically tells it
when and which .bobj.gz file to read.

** Blender C code only knows about the fluid object (and nothing about .bobj.gz
files). To construct a mesh it first queries the fluid object via the getters
from the CPP API for mesh data. Once obtained it uses that information
(information = everything that's necessary to build a mesh: numvertices,
numnormals, numfaces, vertice coords, normals, face coords) to then build a
Blendermesh (DerivedMesh). 

* After another consultation with my mentor Nils Thuerey I implemented a new
version for the liquid inflow. Instead of using just two raycasts to figure out
which points lie inside the mesh, the new approach is using six raycasts.

=== Next up ===

* There are still some issues with the meshes in the viewport that need to be
fixed: scaling does not work correctly and faces are not drawn (mesh only
visible as wireframe - see image above). 

* Caching for the phi grid is missing. With all the reading and writing of
.bobj.gz files I overlooked that one needs to cache the inflow grid as well. It
shouldn't be too difficult to implement though as the phi grid can be cached in
the same fashion as the smoke grids.

* My new liquid inflow is currently not in use (is commented out). I had some
inaccuracies and therefore kept my old code. Next week I'll review the code and
hopefully be able to figure out what's wrong.

=== Questions ===

* In the readBobjFile() from Mantaflow there is a conversion to grid space for
all the vertices. How would that map to the Blender world? I think I am
currently missing something, but getting this right should fix the mesh scaling
issue.

Best wishes,
Sebastián


More information about the Soc-2016-dev mailing list