Commit: 1ec08999b6a2200a1a54533fc9858b5d7dfc1364
Author: Sebastián Barschkis
Date:   Tue Jan 14 21:44:32 2020 +0100
Branches: master
https://developer.blender.org/rB1ec08999b6a2200a1a54533fc9858b5d7dfc1364

Fluid: Additional fix for relative cache paths

Added missing conversion from relative to absolute paths.

===================================================================

M       source/blender/editors/physics/physics_fluid.c

===================================================================

diff --git a/source/blender/editors/physics/physics_fluid.c 
b/source/blender/editors/physics/physics_fluid.c
index 1b7b403ebfb..2bad28bd83d 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -370,6 +370,7 @@ static void fluid_bake_startjob(void *customdata, short 
*stop, short *do_update,
   FluidDomainSettings *mds = job->mmd->domain;
 
   char temp_dir[FILE_MAX];
+  const char *relbase = modifier_path_relbase_from_global(job->ob);
 
   job->stop = stop;
   job->do_update = do_update;
@@ -383,6 +384,7 @@ static void fluid_bake_startjob(void *customdata, short 
*stop, short *do_update,
 
   if (fluid_is_bake_noise(job) || fluid_is_bake_all(job)) {
     BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, 
FLUID_DOMAIN_DIR_NOISE, NULL);
+    BLI_path_abs(temp_dir, relbase);
     BLI_dir_create_recursive(temp_dir); /* Create 'noise' subdir if it does 
not exist already */
     mds->cache_flag &= ~(FLUID_DOMAIN_BAKED_NOISE | 
FLUID_DOMAIN_OUTDATED_NOISE);
     mds->cache_flag |= FLUID_DOMAIN_BAKING_NOISE;
@@ -390,6 +392,7 @@ static void fluid_bake_startjob(void *customdata, short 
*stop, short *do_update,
   }
   if (fluid_is_bake_mesh(job) || fluid_is_bake_all(job)) {
     BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, 
FLUID_DOMAIN_DIR_MESH, NULL);
+    BLI_path_abs(temp_dir, relbase);
     BLI_dir_create_recursive(temp_dir); /* Create 'mesh' subdir if it does not 
exist already */
     mds->cache_flag &= ~(FLUID_DOMAIN_BAKED_MESH | FLUID_DOMAIN_OUTDATED_MESH);
     mds->cache_flag |= FLUID_DOMAIN_BAKING_MESH;
@@ -398,6 +401,7 @@ static void fluid_bake_startjob(void *customdata, short 
*stop, short *do_update,
   if (fluid_is_bake_particle(job) || fluid_is_bake_all(job)) {
     BLI_path_join(
         temp_dir, sizeof(temp_dir), mds->cache_directory, 
FLUID_DOMAIN_DIR_PARTICLES, NULL);
+    BLI_path_abs(temp_dir, relbase);
     BLI_dir_create_recursive(
         temp_dir); /* Create 'particles' subdir if it does not exist already */
     mds->cache_flag &= ~(FLUID_DOMAIN_BAKED_PARTICLES | 
FLUID_DOMAIN_OUTDATED_PARTICLES);
@@ -406,6 +410,7 @@ static void fluid_bake_startjob(void *customdata, short 
*stop, short *do_update,
   }
   if (fluid_is_bake_guiding(job) || fluid_is_bake_all(job)) {
     BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, 
FLUID_DOMAIN_DIR_GUIDE, NULL);
+    BLI_path_abs(temp_dir, relbase);
     BLI_dir_create_recursive(temp_dir); /* Create 'guiding' subdir if it does 
not exist already */
     mds->cache_flag &= ~(FLUID_DOMAIN_BAKED_GUIDE | 
FLUID_DOMAIN_OUTDATED_GUIDE);
     mds->cache_flag |= FLUID_DOMAIN_BAKING_GUIDE;
@@ -413,9 +418,11 @@ static void fluid_bake_startjob(void *customdata, short 
*stop, short *do_update,
   }
   if (fluid_is_bake_data(job) || fluid_is_bake_all(job)) {
     BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, 
FLUID_DOMAIN_DIR_CONFIG, NULL);
+    BLI_path_abs(temp_dir, relbase);
     BLI_dir_create_recursive(temp_dir); /* Create 'config' subdir if it does 
not exist already */
 
     BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, 
FLUID_DOMAIN_DIR_DATA, NULL);
+    BLI_path_abs(temp_dir, relbase);
     BLI_dir_create_recursive(temp_dir); /* Create 'data' subdir if it does not 
exist already */
     mds->cache_flag &= ~(FLUID_DOMAIN_BAKED_DATA | FLUID_DOMAIN_OUTDATED_DATA);
     mds->cache_flag |= FLUID_DOMAIN_BAKING_DATA;
@@ -424,6 +431,7 @@ static void fluid_bake_startjob(void *customdata, short 
*stop, short *do_update,
     if (mds->flags & FLUID_DOMAIN_EXPORT_MANTA_SCRIPT) {
       BLI_path_join(
           temp_dir, sizeof(temp_dir), mds->cache_directory, 
FLUID_DOMAIN_DIR_SCRIPT, NULL);
+      BLI_path_abs(temp_dir, relbase);
       BLI_dir_create_recursive(temp_dir); /* Create 'script' subdir if it does 
not exist already */
     }
   }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to