Index: source/blender/blenkernel/intern/pointcache.c =================================================================== --- source/blender/blenkernel/intern/pointcache.c (revision 15183) +++ source/blender/blenkernel/intern/pointcache.c (working copy) @@ -39,6 +39,7 @@ #include "DNA_object_force.h" #include "DNA_particle_types.h" #include "DNA_scene_types.h" +#include "DNA_userdef_types.h" #include "BLI_blenlib.h" @@ -167,7 +168,11 @@ static int ptcache_path(PTCacheID *pid, char *filename) { Library *lib; - int i; + int i,ul; + + ul = strlen(U.cachedir); + + if (ul > 1)/*so we don't get / */ BLI_add_slash(U.cachedir); lib= (pid)? pid->ob->id.lib: NULL; @@ -184,7 +189,9 @@ if (i > 6) file[i-6] = '\0'; - sprintf(filename, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */ + if (ul > 1) sprintf(filename, "%s%s%s", U.cachedir, PTCACHE_PATH,file);/* add blend file name to pointcache dir */ + else sprintf(filename, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */ + BLI_convertstringcode(filename, blendfilename); BLI_add_slash(filename); return strlen(filename); @@ -192,7 +199,9 @@ /* use the temp path. this is weak but better then not using point cache at all */ /* btempdir is assumed to exist and ALWAYS has a trailing slash */ - sprintf(filename, "%s"PTCACHE_PATH"%d", btempdir, abs(getpid())); + if (ul > 1) sprintf(filename, "%s%s%d", U.cachedir, PTCACHE_PATH, abs(getpid())); + else sprintf(filename, "%s%s%d", btempdir, PTCACHE_PATH, abs(getpid())); + BLI_add_slash(filename); return strlen(filename); } Index: source/blender/blenkernel/BKE_pointcache.h =================================================================== --- source/blender/blenkernel/BKE_pointcache.h (revision 15183) +++ source/blender/blenkernel/BKE_pointcache.h (working copy) @@ -30,6 +30,7 @@ #define BKE_POINTCACHE_H #include "DNA_ID.h" +#include "DNA_userdef_types.h" /* Point cache clearing option, for BKE_ptcache_id_clear, before * and after are non inclusive (they wont remove the cfra) */ Index: source/blender/makesdna/DNA_userdef_types.h =================================================================== --- source/blender/makesdna/DNA_userdef_types.h (revision 15183) +++ source/blender/makesdna/DNA_userdef_types.h (working copy) @@ -165,6 +165,7 @@ char plugseqdir[160]; char pythondir[160]; char sounddir[160]; + char cachedir[160]; /* yafray: temporary xml export directory */ char yfexportdir[160]; short versions, vrmlflag; // tmp for export, will be replaced by strubi Index: source/blender/include/blendef.h =================================================================== --- source/blender/include/blendef.h (revision 15183) +++ source/blender/include/blendef.h (working copy) @@ -310,6 +310,7 @@ /* yafray: for exportdir select */ #define B_YAFRAYDIRFILESEL 338 #define B_PYMENUEVAL 339 /* re-eval scripts registration in menus */ +#define B_POINTCACHEFILESEL 340 /* END Definitions for the fileselect buttons in user prefs */ /* IMAGE: 350 */ Index: source/blender/src/space.c =================================================================== --- source/blender/src/space.c (revision 15183) +++ source/blender/src/space.c (working copy) @@ -4324,6 +4324,15 @@ 0, 0, 0, 0, 0, "Select the default yafray export directory"); uiBlockEndAlign(block); + uiDefBut(block, TEX, 0, "PointCache: ", + (xpos+edgsp+lpref+midsp), y2+buth+rspace, lpref-smfileselbut, buth, + U.cachedir, 1.0, 63.0, 0, 0, + "The default directory for Point Cache files"); + uiDefIconBut(block, BUT, B_POINTCACHEFILESEL, ICON_FILESEL, + (xpos+edgsp+(2*lpref)+midsp-smfileselbut), y2+buth+rspace, smfileselbut, buth, + 0, 0, 0, 0, 0, "Select the default Point Cache Directory"); + uiBlockEndAlign(block); + uiBlockBeginAlign(block); uiDefBut(block, TEX, 0, "Fonts: ", (xpos+edgsp),y2,(lpref-smfileselbut),buth, Index: source/blender/src/headerbuttons.c =================================================================== --- source/blender/src/headerbuttons.c (revision 15183) +++ source/blender/src/headerbuttons.c (working copy) @@ -501,6 +501,18 @@ allqueue(REDRAWALL, 0); } +static void filesel_u_pointcachedir(char *name) +{ + char dir[FILE_MAXDIR], file[FILE_MAXFILE]; + + BLI_cleanup_dir(G.sce, name); + BLI_split_dirfile(name, dir, file); + + strcpy(U.cachedir, dir); + allqueue(REDRAWALL, 0); +} + + static void filesel_u_plugtexdir(char *name) { char dir[FILE_MAXDIR], file[FILE_MAXFILE]; @@ -1451,7 +1463,7 @@ case B_PLAINMENUS: /* is button from space.c *info* */ reset_toolbox(); - break; + break; case B_FLIPINFOMENU: /* is button from space.c *info* */ scrarea_queue_headredraw(curarea); @@ -1479,7 +1491,15 @@ activate_fileselect(FILE_SPECIAL, "SELECT YFEXPORT PATH", U.yfexportdir, filesel_u_yfexportdir); break; - + + case B_POINTCACHEFILESEL: /* is button form space.c *info* */ + if(curarea->spacetype==SPACE_INFO) { + sa= closest_bigger_area(); + areawinset(sa->win); + } + activate_fileselect(FILE_SPECIAL, "SELECT POINTCACHE PATH", U.cachedir, filesel_u_pointcachedir); + break; + case B_FONTDIRFILESEL: /* is button from space.c *info* */ if(curarea->spacetype==SPACE_INFO) { sa= closest_bigger_area();