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:
authorJacques Lucke <jacques@blender.org>2020-03-10 19:32:38 +0300
committerJacques Lucke <jacques@blender.org>2020-03-10 19:33:05 +0300
commit0f1f75178571d9e2644f3b4dd697a5c876bf3ea2 (patch)
tree4cdf18e2119bbe36daf9901a72b12686ed4cb5a2 /source/blender/editors/physics
parenta6d7280b8e1c8ac7c0d6ebcf134290836413168c (diff)
Fix T74525: Fluid caches overwrite each other by default
Reviewers: sebbas Differential Revision: https://developer.blender.org/D7093
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/physics_fluid.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index c4812d373ab..147c765143e 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -189,8 +189,9 @@ static bool fluid_validatepaths(FluidJob *job, ReportList *reports)
/* We do not accept empty paths, they can end in random places silently, see T51176. */
if (mds->cache_directory[0] == '\0') {
- modifier_path_init(
- mds->cache_directory, sizeof(mds->cache_directory), FLUID_DOMAIN_DIR_DEFAULT);
+ char cache_name[64];
+ BKE_fluid_cache_new_name_for_current_session(sizeof(cache_name), cache_name);
+ modifier_path_init(mds->cache_directory, sizeof(mds->cache_directory), cache_name);
BKE_reportf(reports,
RPT_WARNING,
"Fluid: Empty cache path, reset to default '%s'",
@@ -206,8 +207,9 @@ static bool fluid_validatepaths(FluidJob *job, ReportList *reports)
/* We change path to some presumably valid default value, but do not allow bake process to
* continue, this gives user chance to set manually another path. */
if (!dir_exists) {
- modifier_path_init(
- mds->cache_directory, sizeof(mds->cache_directory), FLUID_DOMAIN_DIR_DEFAULT);
+ char cache_name[64];
+ BKE_fluid_cache_new_name_for_current_session(sizeof(cache_name), cache_name);
+ modifier_path_init(mds->cache_directory, sizeof(mds->cache_directory), cache_name);
BKE_reportf(reports,
RPT_ERROR,