Page MenuHome

Mantaflow [Part 7]: Added bake configuration
ClosedPublic

Authored by Sebastián Barschkis (sebbas) on Oct 29 2018, 5:37 PM.

Details

Summary

Similarly to physics_fluid.c (in same directory) which handled the baking process for Elbeem, there is now physics_manta.c which handles it for Mantaflow.

There are two types of jobs: one for baking and another for freeing. The generic jobs will be used to bake / free specific parts of the simulation (e.g. bake mesh, free particles, etc.).

The jobs are only being used in the "modular" cache mode where the simulation has to be baked in parts.

Diff Detail

Repository
rB Blender

Event Timeline

Update manta files after merge with master.

Harbormaster completed remote builds in B3297: Diff 14648.

Very quick review, would need a slightly deeper pass on that one but from first sight nothing wrong here.

source/blender/editors/physics/physics_manta.c
76 ↗(On Diff #14648)

Naming again, would rather see Manta first in names (also for the functions below).

Updated diff with latest changes from fluid-mantaflow branch

Updated diff with latest changes from fluid-mantaflow branch

Sergey Sharybin (sergey) requested changes to this revision.Dec 10 2019, 3:07 PM
Sergey Sharybin (sergey) added inline comments.
source/blender/editors/physics/physics_manta.c
255 ↗(On Diff #19936)

Pretty much sure there is more reliably way that doing string comparison with an operator name.

296 ↗(On Diff #19936)

No need to calculate length of string to see if it's empty. Additionally, error might be nullptr.

if (mds->error != NULL && mds->error[0] != '\0').

This revision now requires changes to proceed.Dec 10 2019, 3:07 PM
Sebastián Barschkis (sebbas) marked 2 inline comments as done.Dec 10 2019, 10:58 PM

See 2fcf705a17dd for changes.

source/blender/editors/physics/physics_manta.c
255 ↗(On Diff #19936)

I agree, not very nice. I cleaned it up a bit so that strings and STREQ() only show up once.
But since wmOperatorType->idname is a char * I don't know how we could identify a job.

wmOperatorType->idname is also supposed to be a "Unique identifier".

There is still room for improvement, but those could happen as a regular development. At least now refactor wouldn't miss anything important.

source/blender/editors/physics/physics_manta.c
255 ↗(On Diff #19936)

wmOperatorType->idname is also supposed to be a "Unique identifier".

Sure, but it was very simple to miss identifier in a string after refactor.
With a define (after your update) it's no longer the case.

Guess in an ideal word we would store a bake type in MantaJob. Not sure the boiler plate will keep this good feeling on a good level though.

This revision is now accepted and ready to land.Dec 11 2019, 3:06 PM
Sebastián Barschkis (sebbas) marked an inline comment as done.

Updated diff with latest changes from fluid-mantaflow branch

Updated diff with latest changes from fluid-mantaflow branch