From 3d1b5e35bddb9e54257021b2f2d610fbf5f0814b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastia=CC=81n=20Barschkis?= Date: Tue, 13 Oct 2020 21:46:52 +0200 Subject: Fluid: Enabled OpenVDB precision argument This way particles can be saved with the custom OpenVDB precision options that were introduced in the latest Mantaflow update. --- intern/mantaflow/intern/MANTA_main.cpp | 12 +++++++----- intern/mantaflow/intern/strings/fluid_script.h | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'intern/mantaflow') diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp index cc702b82151..ef7cd4721b0 100644 --- a/intern/mantaflow/intern/MANTA_main.cpp +++ b/intern/mantaflow/intern/MANTA_main.cpp @@ -740,11 +740,13 @@ void MANTA::initializeRNAMap(FluidModifierData *fmd) else if (fds->openvdb_compression == VDB_COMPRESSION_BLOSC) vdbCompressionMethod = "Compression_Blosc"; - string vdbPrecisionHalf = "True"; - if (fds->openvdb_data_depth == VDB_PRECISION_HALF_FLOAT) - vdbPrecisionHalf = "True"; - else if (fds->openvdb_data_depth == VDB_PRECISION_FULL_FLOAT) - vdbPrecisionHalf = "False"; + string vdbPrecisionHalf = "Precision_Half"; + if (fds->openvdb_data_depth == VDB_PRECISION_FULL_FLOAT) + vdbPrecisionHalf = "Precision_Full"; + else if (fds->openvdb_data_depth == VDB_PRECISION_HALF_FLOAT) + vdbPrecisionHalf = "Precision_Half"; + else if (fds->openvdb_data_depth == VDB_PRECISION_MINI_FLOAT) + vdbPrecisionHalf = "Precision_Mini"; mRNAMap["USING_SMOKE"] = getBooleanString(fds->type == FLUID_DOMAIN_TYPE_GAS); mRNAMap["USING_LIQUID"] = getBooleanString(fds->type == FLUID_DOMAIN_TYPE_LIQUID); diff --git a/intern/mantaflow/intern/strings/fluid_script.h b/intern/mantaflow/intern/strings/fluid_script.h index 65773221042..9e723f69c70 100644 --- a/intern/mantaflow/intern/strings/fluid_script.h +++ b/intern/mantaflow/intern/strings/fluid_script.h @@ -165,7 +165,7 @@ gravity_s$ID$ *= scaleAcceleration_s$ID$ # scale from world acceleration to cell \n\ # OpenVDB options\n\ vdbCompression_s$ID$ = $COMPRESSION_OPENVDB$\n\ -vdbPrecisionHalf_s$ID$ = $PRECISION_OPENVDB$\n\ +vdbPrecision_s$ID$ = $PRECISION_OPENVDB$\n\ \n\ # Cache file names\n\ file_data_s$ID$ = '$NAME_DATA$'\n\ @@ -718,7 +718,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$, precisionHalf=vdbPrecisionHalf_s$ID$)\n\ + saveCombined = save(name=file, objects=list(dict.values()), worldSize=domainSize_s$ID$, skipDeletedParts=True, compression=vdbCompression_s$ID$, precision=vdbPrecision_s$ID$)\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\ -- cgit v1.2.3