Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastián Barschkis <sebbas@sebbas.org>2021-02-02 19:50:08 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2021-02-02 19:50:08 +0300
commit8c36f6becff2e53e8d545c4c82f3334588140c8f (patch)
tree3a7c787263af43d332ecab791c08da5d59fc6de4
parent9ad828dbad94d279521875db47a3472a38cc9b29 (diff)
Fix T84649: Quick liquid causing crash on scale operation
This commit makes use of the updated fluid sources files (previous commit rB9ad828dbad94d279521875db47a3472a38cc9b29)
-rw-r--r--intern/mantaflow/intern/MANTA_main.cpp4
-rw-r--r--intern/mantaflow/intern/strings/fluid_script.h2
-rw-r--r--source/blender/blenkernel/intern/fluid.c7
3 files changed, 9 insertions, 4 deletions
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index 1ed2b558938..6c8e45ceeb4 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -1984,7 +1984,9 @@ float MANTA::getTimestep()
bool MANTA::needsRealloc(FluidModifierData *fmd)
{
FluidDomainSettings *fds = fmd->domain;
- return (fds->res[0] != mResX || fds->res[1] != mResY || fds->res[2] != mResZ);
+ return ((fds->res_max[0] - fds->res_min[0]) != mResX ||
+ (fds->res_max[1] - fds->res_min[1]) != mResY ||
+ (fds->res_max[2] - fds->res_min[2]) != mResZ);
}
void MANTA::adaptTimestep()
diff --git a/intern/mantaflow/intern/strings/fluid_script.h b/intern/mantaflow/intern/strings/fluid_script.h
index e65310c4bfd..3bf8e66c110 100644
--- a/intern/mantaflow/intern/strings/fluid_script.h
+++ b/intern/mantaflow/intern/strings/fluid_script.h
@@ -711,7 +711,7 @@ def fluid_file_export_s$ID$(framenr, file_format, path, dict, file_name=None, mo
file = os.path.join(path, file_name + '_' + framenr + file_format)\n\
if not os.path.isfile(file) or mode_override:\n\
if file_format == '.vdb':\n\
- saveCombined = save(name=file, objects=list(dict.values()), worldSize=domainSize_s$ID$, skipDeletedParts=True, compression=vdbCompression_s$ID$, precision=vdbPrecision_s$ID$, clip=vdbClip_s$ID$, clipGrid=clipGrid)\n\
+ saveCombined = save(name=file, objects=list(dict.values()), worldSize=domainSize_s$ID$, skipDeletedParts=True, compression=vdbCompression_s$ID$, precision=vdbPrecision_s$ID$, clip=vdbClip_s$ID$, clipGrid=clipGrid, meta=True)\n\
elif file_format == '.bobj.gz' or file_format == '.obj':\n\
for name, object in dict.items():\n\
if not os.path.isfile(file) or mode_override:\n\
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 0f8a11a40b2..59248e5f9f8 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -4001,8 +4001,11 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd,
has_config = manta_read_config(fds->fluid, fmd, mesh_frame);
}
- /* Update mesh data from file is faster than via Python (manta_read_mesh()). */
- has_mesh = manta_read_mesh(fds->fluid, fmd, mesh_frame);
+ /* Only load the mesh at the resolution it ways originally simulated at.
+ * The mesh files don't have a header, i.e. the don't store the grid resolution. */
+ if (!manta_needs_realloc(fds->fluid, fmd)) {
+ has_mesh = manta_read_mesh(fds->fluid, fmd, mesh_frame);
+ }
}
/* Read particles cache. */