diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-06-24 16:30:49 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-06-24 17:07:35 +0300 |
commit | 9951858942893adeb4eef27ec8a8471a179e9c59 (patch) | |
tree | 46fbf6cc8f3fe65b05ade1b0a6d23737f48bc5f7 /source/blender/editors | |
parent | 9fe64948abe991d18c1af3a52d81e87c24d39687 (diff) |
Fluid: Improved OpenVDB support for fluid caches
This commit makes uses of the new OpenVDB IO in Mantaflow (introduced in 781f783a66ac).
From now on, fluid cache files in OpenVDB format will contain a list of grids per frame (before: one .vdb file per grid per frame). Besides regular grids, particle systems are also stored using OpenVDBs PointGrid data structures.
All older cache formats will remain fully functional:
- Uni caches (.uni) files are still available from the UI and can be used as before
- Raw caches (.raw) are no longer available from the UI, but loading them is still possible
- Old OpenVDB caches (one .vdb per grid) can no longer be baked either, but loading them is still possible.
It is also no longer possible to choose file formats for 'Noise' and 'Particles'. Instead there are now options to set the file format for 'Volumetric' and for 'Mesh' data.
Known issues (planned to be resolved soon):
- OpenVDB files are currently not taking into consideration the clipping value (FluidDomainSettings). Empty cells are therefore being written too. Depending on the scene, this can make file sizes unnecessarily large.
- Domains are not being exported at their world position. Instead they are always clipped to the origin.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/physics/physics_fluid.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 8524870c15e..8f6b5aa8bc3 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -270,31 +270,31 @@ static void fluid_bake_sequence(FluidJob *job) *(job->do_update) = true; } - /* Get current pause frame (pointer) - depending on bake type */ + /* Get current pause frame (pointer) - depending on bake type. */ pause_frame = job->pause_frame; - /* Set frame to start point (depending on current pause frame value) */ + /* Set frame to start point (depending on current pause frame value). */ is_first_frame = ((*pause_frame) == 0); frame = is_first_frame ? mds->cache_frame_start : (*pause_frame); - /* Save orig frame and update scene frame */ + /* Save orig frame and update scene frame. */ orig_frame = CFRA; CFRA = frame; - /* Loop through selected frames */ + /* Loop through selected frames. */ for (; frame <= mds->cache_frame_end; frame++) { const float progress = (frame - mds->cache_frame_start) / (float)frames; - /* Keep track of pause frame - needed to init future loop */ + /* Keep track of pause frame - needed to init future loop. */ (*pause_frame) = frame; - /* If user requested stop, quit baking */ + /* If user requested stop, quit baking. */ if (G.is_break) { job->success = 0; return; } - /* Update progress bar */ + /* Update progress bar. */ if (job->do_update) { *(job->do_update) = true; } @@ -304,17 +304,17 @@ static void fluid_bake_sequence(FluidJob *job) CFRA = frame; - /* Update animation system */ + /* Update animation system. */ ED_update_for_newframe(job->bmain, job->depsgraph); - /* If user requested stop, quit baking */ + /* If user requested stop, quit baking. */ if (G.is_break) { job->success = 0; return; } } - /* Restore frame position that we were on before bake */ + /* Restore frame position that we were on before bake. */ CFRA = orig_frame; } @@ -355,9 +355,9 @@ static void fluid_bake_endjob(void *customdata) WM_set_locked_interface(G_MAIN->wm.first, false); /* Bake was successful: - * Report for ended bake and how long it took */ + * Report for ended bake and how long it took. */ if (job->success) { - /* Show bake info */ + /* Show bake info. */ WM_reportf( RPT_INFO, "Fluid: %s complete! (%.2f)", job->name, PIL_check_seconds_timer() - job->start); } @@ -365,7 +365,7 @@ static void fluid_bake_endjob(void *customdata) if (mds->error[0] != '\0') { WM_reportf(RPT_ERROR, "Fluid: %s failed: %s", job->name, mds->error); } - else { /* User canceled the bake */ + else { /* User canceled the bake. */ WM_reportf(RPT_WARNING, "Fluid: %s canceled!", job->name); } } |