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>2020-01-24 19:08:28 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-01-24 19:23:50 +0300
commit64b152c2547e3da80c52347a89d6c1f71d3287bc (patch)
tree4befa0b6dd3ccfad96542085751d4f1ea75da4bb /intern/mantaflow
parentcb6f9c2f198eb2a8ec2e85bd112dceae0bda15f2 (diff)
Fluid: Added resume cache boolean to standalone scripts
Exported Manta script was missing the new resume options in the data load functions.
Diffstat (limited to 'intern/mantaflow')
-rw-r--r--intern/mantaflow/intern/MANTA_main.cpp2
-rw-r--r--intern/mantaflow/intern/strings/fluid_script.h3
-rw-r--r--intern/mantaflow/intern/strings/liquid_script.h10
-rw-r--r--intern/mantaflow/intern/strings/smoke_script.h8
4 files changed, 12 insertions, 11 deletions
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index 024c562e64c..7f6ff9094c6 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -934,6 +934,8 @@ std::string MANTA::getRealValue(const std::string &varName, FluidModifierData *m
ss << mmd->domain->gravity[2];
else if (varName == "CACHE_DIR")
ss << mmd->domain->cache_directory;
+ else if (varName == "CACHE_RESUMABLE")
+ ss << (mmd->domain->cache_type == FLUID_DOMAIN_CACHE_FINAL ? "False" : "True");
else if (varName == "USING_ADAPTIVETIME")
ss << (mmd->domain->flags & FLUID_DOMAIN_USE_ADAPTIVE_TIME ? "True" : "False");
else if (varName == "USING_SPEEDVECTORS")
diff --git a/intern/mantaflow/intern/strings/fluid_script.h b/intern/mantaflow/intern/strings/fluid_script.h
index 436bc037a92..f66f2fadcb1 100644
--- a/intern/mantaflow/intern/strings/fluid_script.h
+++ b/intern/mantaflow/intern/strings/fluid_script.h
@@ -693,6 +693,7 @@ if (GUI):\n\
gui.pause()\n\
\n\
cache_dir = '$CACHE_DIR$'\n\
+cache_resumable = $CACHE_RESUMABLE$\n\
file_format_data = '.uni'\n\
file_format_noise = '.uni'\n\
file_format_particles = '.uni'\n\
@@ -710,7 +711,7 @@ while current_frame <= end_frame:\n\
\n\
# Load already simulated data from cache:\n\
if loop_cnt < from_cache_cnt:\n\
- load(current_frame)\n\
+ load(current_frame, cache_resumable)\n\
\n\
# Otherwise simulate new data\n\
else:\n\
diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h
index df0a5254fe2..6cbbf06f0d2 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -438,13 +438,11 @@ def liquid_save_particles_$ID$(path, framenr, file_format, resumable):\n\
const std::string liquid_standalone =
"\n\
# Helper function to call cache load functions\n\
-def load(frame):\n\
- fluid_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data)\n\
- liquid_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data)\n\
- liquid_load_flip_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_particles)\n\
+def load(frame, cache_resumable):\n\
+ fluid_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data, cache_resumable)\n\
+ liquid_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data, cache_resumable)\n\
if using_sndparts_s$ID$:\n\
- fluid_load_particles_$ID$(os.path.join(cache_dir, 'particles'), frame, file_format_particles)\n\
- liquid_load_particles_$ID$(os.path.join(cache_dir, 'particles'), frame, file_format_particles)\n\
+ liquid_load_particles_$ID$(os.path.join(cache_dir, 'particles'), frame, file_format_particles, cache_resumable)\n\
if using_mesh_s$ID$:\n\
liquid_load_mesh_$ID$(os.path.join(cache_dir, 'mesh'), frame, file_format_mesh)\n\
if using_guiding_s$ID$:\n\
diff --git a/intern/mantaflow/intern/strings/smoke_script.h b/intern/mantaflow/intern/strings/smoke_script.h
index e77074f35cb..9277923fa7a 100644
--- a/intern/mantaflow/intern/strings/smoke_script.h
+++ b/intern/mantaflow/intern/strings/smoke_script.h
@@ -584,11 +584,11 @@ def smoke_save_noise_$ID$(path, framenr, file_format, resumable):\n\
const std::string smoke_standalone =
"\n\
# Helper function to call cache load functions\n\
-def load(frame):\n\
- fluid_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data)\n\
- smoke_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data)\n\
+def load(frame, cache_resumable):\n\
+ fluid_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data, cache_resumable)\n\
+ smoke_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data, cache_resumable)\n\
if using_noise_s$ID$:\n\
- smoke_load_noise_$ID$(os.path.join(cache_dir, 'noise'), frame, file_format_noise)\n\
+ smoke_load_noise_$ID$(os.path.join(cache_dir, 'noise'), frame, file_format_noise, cache_resumable)\n\
if using_guiding_s$ID$:\n\
fluid_load_guiding_$ID$(os.path.join(cache_dir, 'guiding'), frame, file_format_data)\n\
\n\