利用者:Sebbas/GSoC 2016/Reports/Week 4
< 利用者:Sebbas | GSoC 2016 | Reports
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 settled 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. (rBc933f959af9d, rB6a288555ebf0, rBd67e7284b908)
- The pointcache triggers the fluid objects functions. It basically tells it when and which .bobj.gz file to read. (rB6dd1cf2a3e95)
- 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 (rB6a288555ebf0) 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). (rB3b521e701287)
- 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. (rB0972761bf0fa)
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 (this one: rB0972761bf0fa) 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.