diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2021-02-05 18:23:02 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2021-02-05 18:23:02 +0300 |
commit | a5637756491ca1b9baa544ad86f74627f6333d04 (patch) | |
tree | ba7e4caa18df2cb3552f157c80fd059397f95276 /extern/mantaflow/preprocessed/fileio | |
parent | 4212ea7b7de70f2346e27505ae7e966a7830f038 (diff) |
Fluid: Updated Mantaflow source files
This updates fixes the following issues (critical for 2.92):
- Issue that prevented dense 'int' grids from being exported (incorrect clip value)
- Issue with particles outside out of domain bounds (position between -1 and 0) not being deleted
Diffstat (limited to 'extern/mantaflow/preprocessed/fileio')
-rw-r--r-- | extern/mantaflow/preprocessed/fileio/iovdb.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extern/mantaflow/preprocessed/fileio/iovdb.cpp b/extern/mantaflow/preprocessed/fileio/iovdb.cpp index cc2d0aa508d..e615741e0f7 100644 --- a/extern/mantaflow/preprocessed/fileio/iovdb.cpp +++ b/extern/mantaflow/preprocessed/fileio/iovdb.cpp @@ -209,11 +209,11 @@ typename GridType::Ptr exportVDB(Grid<T> *from, float clip, openvdb::FloatGrid:: openvdb::Coord(from->getSizeX() - 1, from->getSizeY() - 1, from->getSizeZ() - 1)); openvdb::tools::Dense<ValueT, openvdb::tools::MemoryLayout::LayoutXYZ> dense(bbox, data); - // Trick: Set clip value to very small / negative value in order to copy all values of dense - // grids - float tmpClip = (from->saveSparse()) ? clip : -std::numeric_limits<Real>::max(); + // Use clip value, or (when not exporting in sparse mode) clear it in order to copy all values + // of dense grid + ValueT tmpClip = (from->saveSparse()) ? ValueT(clip) : ValueT(0); // Copy from dense to sparse grid structure considering clip value - openvdb::tools::copyFromDense(dense, *to, ValueT(tmpClip)); + openvdb::tools::copyFromDense(dense, *to, tmpClip); // If present, use clip grid to trim down current vdb grid even more if (from->saveSparse() && clipGrid && !clipGrid->empty()) { @@ -245,10 +245,10 @@ void exportVDB(ParticleDataImpl<MantaType> *from, std::vector<VDBType> vdbValues; std::string name = from->getName(); + BasicParticleSystem *pp = dynamic_cast<BasicParticleSystem *>(from->getParticleSys()); FOR_PARTS(*from) { // Optionally, skip exporting particles that have been marked as deleted - BasicParticleSystem *pp = dynamic_cast<BasicParticleSystem *>(from->getParticleSys()); if (skipDeletedParts && !pp->isActive(idx)) { continue; } |