Commit: 4e4e2940eb27de50d4c3ba95f204b0315c866216
Author: Kévin Dietrich
Date:   Sun Jun 7 01:27:22 2015 +0200
Branches: openvdb
https://developer.blender.org/rB4e4e2940eb27de50d4c3ba95f204b0315c866216

Ensure cache directory exists.

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

M       source/blender/blenkernel/intern/smoke.c

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

diff --git a/source/blender/blenkernel/intern/smoke.c 
b/source/blender/blenkernel/intern/smoke.c
index 776559e..7bec692 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -3127,14 +3127,18 @@ static void cache_filename(char *string, const char 
*path, const char *fname, co
 {
        char cachepath[FILE_MAX];
 
-       BLI_join_dirfile(cachepath, sizeof(cachepath), path, fname);
-
        if (string == NULL) {
                return;
        }
 
-       BLI_strncpy(string, cachepath, FILE_MAX - 10);
-       BLI_path_abs(string, relbase);
+       BLI_strncpy(cachepath, path, FILE_MAX - 10);
+       BLI_path_abs(cachepath, relbase);
+
+       if (!BLI_exists(cachepath)) {
+               BLI_dir_create_recursive(cachepath);
+       }
+
+       BLI_join_dirfile(string, sizeof(cachepath), cachepath, fname);
        BLI_path_frame(string, frame, 4);
        BLI_ensure_extension(string, FILE_MAX, ".vdb");
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to